﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.CCUiMlmMultipleLocationsManipulationDlg
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using DnProcessSimulateCommands.MultipleLocationsManipulation;
using EngineeringInternalExtension;
using EngineeringInternalExtension.ModelObjects;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Drawing;
using System.Resources;
using System.Windows.Forms;
using Tecnomatix.Engineering;
using Tecnomatix.Engineering.PrivateImplementationDetails;
using Tecnomatix.Engineering.Ui;
using UiInternalControls;


namespace DnProcessSimulateCommands;

public class CCUiMlmMultipleLocationsManipulationDlg : TxForm
{
  private const string _STRING_TABLE_LOCATION = "DnProcessSimulateCommands.MultipleLocationsManipulation.MlmStringTable";
  private int _indexOfLeadingObjectInTheList = -1;
  private CApMlmPlacementManipulator _placementManipulator;
  private List<Tuple<TxTransformation, TxTransformation>> _locationTransformation;
  private List<double> _lastLocationDelta;
  private bool _wereChangesMade;
  private bool _cancelAction;
  private double _translationBeforeEdit;
  private double _translateStepValue = 100.0;
  private double _translateValue;
  private double _rotationBeforeEdit;
  private double _rotateStepValue = Math.PI / 18.0;
  private double _rotateValue;
  private bool _pauseDisplayRefresh;
  private bool _isShiftKeyPressed;
  private List<LocationNewStatus> _locationsStatus;
  private bool _insertingMultipleLocs;
  private bool _arcLocationsWarningMessageWasDisplayed;
  private bool _allowManipulatingArcLocations;
  private CApMlmSharedLogic _sharedLogic;
  private int _indexOfSelectedAxis;
  private bool _wasRotationProcessed;
  private bool _wasTranslationProcessed;
  private TxTransformation _currentReferenceFrame;
  private TxTransformation _projectedLocation;
  private bool isFrameOfReferenceValid;
  private TxPickLevelEx _originalPickLevel;
  private bool _manipulateViaPlacement;
  private bool m_continuousTransactionRunning;
  private const int _SIZE_OF_DIALOG_WITH_SMALL_LOCATIONS_LIST = 411;
  private const int _SIZE_OF_DIALOG_WITH_LARGE_LOCATIONS_LIST = 493;
  private const int _LOCATION_ICON_COLUMN_NUMBER = 0;
  private const int _LOCATION_NAME_COLUMN_NUMBER = 1;
  private const int _LOCATION_PROJECTION_RESULT_COLUMN_NUMBER = 2;
  private IContainer components;
  private Label lblTranslateAlong;
  private Label lblRotateArround;
  private CheckBox cbLimitOptions;
  private CheckBox cbRotateToMaximum;
  private TxObjGridCtrl txOgObjects;
  private Button btnClose;
  private Button btnReset;
  private CUiContinuousButton btnTranslateLeft;
  private TxLinkLabel llTranslateStep;
  private TextBox tbTranslateValue;
  private CUiContinuousButton btnTranslateRight;
  private TextBox textBox1t;
  private CUiContinuousButton btnRotateRight;
  private TextBox tbRotateValue;
  private TxLinkLabel llRotateStep;
  private CUiContinuousButton btnRotateLeft;
  private RadioButton rbX;
  private RadioButton rbZ;
  private RadioButton rbY;
  private RadioButton rbRz;
  private RadioButton rbRy;
  private RadioButton rbRx;
  private ImageList ilSmallButtonsImages;
  private GroupBox gbTranslation;
  private Label lblApplyTranslationAxis;
  private ImageList ilLargeButtonsImages;
  private GroupBox gbRotate;
  private Label lblApplyRotationAxis;
  private TxButtonComboBox txbcbApplyRotationAxis;
  private GroupBox gbSettings;
  private CheckBox cbFollowMode;
  private ToolTip ttButtonsTooltip;
  private TxButtonComboBox txbcbApplyTranslationAxis;
  private TxToolStrip toolStrip1;
  private TxToolStripButton tsbResetLocationsAbsoluteLocation;
  private TxToolStripButton tsbSnapLocationsToMaxAllowed;
  private ToolStripSeparator toolStripSeparator1;
  private TxToolStripButton tsbShowCone;
  private ImageList ilNavigationButtonIcons;
  private ToolTip ttNavigationControl;
  private RadioButton m_eachRelativeToSelfFrameRdBtn;
  private RadioButton m_relativeToFrameRdBtn;
  private TxFrameComboBoxCtrl m_txFrameComboBoxCtrlRelative;
  private GroupBox gbFrameRef;
  private RadioButton m_eachRelativeToOriginalProjectionRdBtn;
  private TxToolStripDropDownButton toolStripFlipDropDownButton1;
  private TxToolStripMenuItem tsbFlipLocation1;
  private TxToolStripMenuItem tsbFlipLocation2;

  private TxTransformation currentReferenceFrame
  {
    get
    {
      if (this.m_eachRelativeToSelfFrameRdBtn.Checked)
        return (TxTransformation) null;
      return this.m_eachRelativeToOriginalProjectionRdBtn.Checked ? this._projectedLocation : this._currentReferenceFrame;
    }
  }

  public double TranslateStepValue
  {
    get => this._translateStepValue;
    set
    {
      this._translateStepValue = value;
      this.SetStepValues();
    }
  }

  public double RotateStepValue
  {
    get => this._rotateStepValue;
    set
    {
      this._rotateStepValue = value;
      this.SetStepValues();
    }
  }

  internal CApMlmPlacementManipulator Placement
  {
    get => this._placementManipulator;
    set => this._placementManipulator = value;
  }

  public CCUiMlmMultipleLocationsManipulationDlg()
  {
    this._originalPickLevel = TxGraphicViewerEx.PickLevel;
    this.InitializeComponent();
    ((Control) this.m_txFrameComboBoxCtrlRelative).AutoSize = false;
    ((Control) this.txOgObjects).GotFocus += new EventHandler(this.txOgObjects_GotFocus);
    this._locationsStatus = new List<LocationNewStatus>();
    this._placementManipulator = new CApMlmPlacementManipulator(new Action(this._placementManipulator_ElementPicked));
    this._sharedLogic = new CApMlmSharedLogic();
    this._sharedLogic.InitializeFollowMode();
    this.m_txFrameComboBoxCtrlRelative.ValidFrameSet += new TxFrameComboBoxCtrl_ValidFrameSetEventHandler(this.m_txFrameComboBoxCtrlRelative_ValidFrameSet);
    this.m_txFrameComboBoxCtrlRelative.InvalidFrameSet += new TxFrameComboBoxCtrl_InvalidFrameSetEventHandler(this.m_txFrameComboBoxCtrlRelative_InvalidFrameSet);
    ((Control) this.m_txFrameComboBoxCtrlRelative).LostFocus += new EventHandler(this.m_txFrameComboBoxCtrlRelative_LostFocus);
    this.txOgObjects.BeforeLoseFocus += new Action<object, EventArgs>(this.txOgObjects_BeforeLoseFocus);
    this.tsbResetLocationsAbsoluteLocation.SetImage(TxImageManager.GetImageByKey("ResetAbsoluteLocation"));
    this.tsbSnapLocationsToMaxAllowed.SetImage(TxImageManager.GetImageByKey("SnapToMaximumAllowed"));
    this.toolStripFlipDropDownButton1.SetImage(TxImageManager.GetImageByKey("FlipLocations"));
    this.tsbFlipLocation1.SetImage(TxImageManager.GetImageByKey("FlipLocations"));
    this.tsbFlipLocation2.SetImage(TxImageManager.GetImageByKey("FlipLocationsOnSolid"));
    this.tsbShowCone.SetImage(TxImageManager.GetImageByKey("ShowLocationLimits"));
    ((TxButton) this.btnTranslateLeft).SetImage(TxImageManager.GetImageByKey("ArrowLeft"), new Size());
    ((TxButton) this.btnTranslateRight).SetImage(TxImageManager.GetImageByKey("ArrowRight"), new Size());
    ((TxButton) this.btnRotateLeft).SetImage(TxImageManager.GetImageByKey("ArrowLeft"), new Size());
    ((TxButton) this.btnRotateRight).SetImage(TxImageManager.GetImageByKey("ArrowRight"), new Size());
    this.cbFollowMode.Image = TxImageManager.GetImageByKey("FollowMode").ConvertTo<Image>(new Size());
  }

  private void rbX_CheckedChanged(object sender, EventArgs e)
  {
    this._translateValue = 0.0;
    if (this.rbX.Checked)
      this.rbRx.Checked = this.rbRy.Checked = this.rbRz.Checked = false;
    this.ClearLastLocationDeltas();
    this.SetEnabledCommandsOnDialog();
    this.SelectApplyAxisAction();
    this.UpdateListStatus();
    if (this._manipulateViaPlacement)
      return;
    this.Placement.SelectedAxis = (TxPlacementManipulatorElement) 1;
  }

  private void rbY_CheckedChanged(object sender, EventArgs e)
  {
    this._translateValue = 0.0;
    if (this.rbY.Checked)
      this.rbRx.Checked = this.rbRy.Checked = this.rbRz.Checked = false;
    this.ClearLastLocationDeltas();
    this.SetEnabledCommandsOnDialog();
    this.SelectApplyAxisAction();
    this.UpdateListStatus();
    if (this._manipulateViaPlacement)
      return;
    this.Placement.SelectedAxis = (TxPlacementManipulatorElement) 4;
  }

  private void rbZ_CheckedChanged(object sender, EventArgs e)
  {
    this._translateValue = 0.0;
    if (this.rbZ.Checked)
      this.rbRx.Checked = this.rbRy.Checked = this.rbRz.Checked = false;
    this.ClearLastLocationDeltas();
    this.SetEnabledCommandsOnDialog();
    this.SelectApplyAxisAction();
    this.UpdateListStatus();
    if (this._manipulateViaPlacement)
      return;
    this.Placement.SelectedAxis = (TxPlacementManipulatorElement) 7;
  }

  private void btnTranslateLeft_ContinuousClick(object sender, EventArgs e)
  {
    this._wereChangesMade = true;
    double step = -1.0 * this._translateStepValue;
    this.TranslateClicked(double.Parse(this.tbTranslateValue.Text), step);
  }

  private void btnTranslateLeft_ContinuousClickStarted(object sender, EventArgs e)
  {
    if (this.m_continuousTransactionRunning)
      return;
    TxApplication.ActiveUndoManager.StartTransaction();
    this.m_continuousTransactionRunning = true;
  }

  private void btnTranslateLeft_ContinuousClickEnded(object sender, EventArgs e)
  {
    if (!this.m_continuousTransactionRunning)
      return;
    TxApplication.ActiveUndoManager.EndTransaction();
    this.m_continuousTransactionRunning = false;
  }

  private void btnTranslateRight_ContinuousClick(object sender, EventArgs e)
  {
    this._wereChangesMade = true;
    double translateStepValue = this._translateStepValue;
    this.TranslateClicked(double.Parse(this.tbTranslateValue.Text), translateStepValue);
  }

  private void TranslateClicked(double oldValue, double step)
  {
    double num = oldValue + step;
    if (this.rbX.Checked)
      this.Translate(oldValue, num, 0.0, 0.0, 0.0, 0.0, this.txOgObjects.Objects);
    else if (this.rbY.Checked)
      this.Translate(0.0, 0.0, oldValue, num, 0.0, 0.0, this.txOgObjects.Objects);
    else if (this.rbZ.Checked)
      this.Translate(0.0, 0.0, 0.0, 0.0, oldValue, num, this.txOgObjects.Objects);
    this.tbTranslateValue.Text = num.ToString("F" + TxApplication.Options.Units.LinearDigitsAfterDecimalPoint.ToString());
  }

  private void tbTranslateValue_Enter(object sender, EventArgs e)
  {
    this._wasTranslationProcessed = false;
    double.TryParse(this.tbTranslateValue.Text, out this._translationBeforeEdit);
  }

  private void tbTranslateValue_Leave(object sender, EventArgs e)
  {
    if (this._wasTranslationProcessed)
    {
      this._wasTranslationProcessed = false;
    }
    else
    {
      double result = 0.0;
      if (double.TryParse(this.tbTranslateValue.Text, out result))
      {
        this._wereChangesMade = true;
        if (this.rbX.Checked)
          this.Translate(this._translationBeforeEdit, result, 0.0, 0.0, 0.0, 0.0, this.txOgObjects.Objects);
        else if (this.rbY.Checked)
          this.Translate(0.0, 0.0, this._translationBeforeEdit, result, 0.0, 0.0, this.txOgObjects.Objects);
        else if (this.rbZ.Checked)
          this.Translate(0.0, 0.0, 0.0, 0.0, this._translationBeforeEdit, result, this.txOgObjects.Objects);
        this.tbTranslateValue.Text = result.ToString("F" + TxApplication.Options.Units.LinearDigitsAfterDecimalPoint.ToString());
      }
      else
      {
        this.tbTranslateValue.Undo();
        this.tbTranslateValue.Text = this._translationBeforeEdit.ToString("F" + TxApplication.Options.Units.LinearDigitsAfterDecimalPoint.ToString());
      }
    }
  }

  private void tbTranslateValue_KeyDown(object sender, KeyEventArgs e)
  {
    if (e.KeyCode != Keys.Return)
      return;
    double result = 0.0;
    if (double.TryParse(this.tbTranslateValue.Text, out result))
    {
      this._wereChangesMade = true;
      if (this.rbX.Checked)
        this.Translate(this._translationBeforeEdit, result, 0.0, 0.0, 0.0, 0.0, this.txOgObjects.Objects);
      else if (this.rbY.Checked)
        this.Translate(0.0, 0.0, this._translationBeforeEdit, result, 0.0, 0.0, this.txOgObjects.Objects);
      else if (this.rbZ.Checked)
        this.Translate(0.0, 0.0, 0.0, 0.0, this._translationBeforeEdit, result, this.txOgObjects.Objects);
      this.tbTranslateValue.Text = result.ToString("F" + TxApplication.Options.Units.LinearDigitsAfterDecimalPoint.ToString());
    }
    else
    {
      this.tbTranslateValue.Undo();
      this.tbTranslateValue.Text = this._translationBeforeEdit.ToString("F" + TxApplication.Options.Units.LinearDigitsAfterDecimalPoint.ToString());
    }
    this._wasTranslationProcessed = true;
  }

  private void Translate(
    double oldValueX,
    double newValueX,
    double oldValueY,
    double newValueY,
    double oldValueZ,
    double newValueZ,
    TxObjectList locations,
    bool updateStateOnRollback = true)
  {
    TxApplication.ActiveUndoManager.StartTransaction();
    foreach (ITxObject location in (Collection<ITxObject>) locations)
    {
      int num = ((Collection<ITxObject>) this.txOgObjects.Objects).IndexOf(location);
      ITxLocationOperation theLocation = location as ITxLocationOperation;
      double lastLocationDelta = this._lastLocationDelta[num];
      bool shouldFollowModeOnTheLocation = false;
      if (this._indexOfLeadingObjectInTheList > -1)
        shouldFollowModeOnTheLocation = theLocation == ((Collection<ITxObject>) this.txOgObjects.Objects)[this._indexOfLeadingObjectInTheList];
      TxTransformation currentReferenceFrame = this.GetCurrentReferenceFrame(num);
      TxTransformation absoluteLocation1 = (theLocation as ITxLocatableObject).AbsoluteLocation;
      LocationNewStatus newStatus = this._sharedLogic.Translate(oldValueX, newValueX, oldValueY, newValueY, oldValueZ, newValueZ, ref theLocation, this._locationsStatus[num], ref lastLocationDelta, this.cbLimitOptions.Checked, this.cbRotateToMaximum.Checked, shouldFollowModeOnTheLocation, currentReferenceFrame);
      TxTransformation absoluteLocation2 = (theLocation as ITxLocatableObject).AbsoluteLocation;
      if (updateStateOnRollback || !absoluteLocation1.Equals((object) absoluteLocation2) || this._sharedLogic.LastGunAndRobotOnLocationState == CApMlmSharedLogic.eGunAndRobotOnLocationState.Success)
      {
        this._lastLocationDelta[num] = lastLocationDelta;
        this.UpdateStatus(num, newStatus);
      }
    }
    TxApplication.ActiveUndoManager.EndTransaction();
    this.RefreshFrameOfReferenceLocation();
    TxApplication.RefreshDisplay();
  }

  private void llTranslateStep_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
  {
    TxValueStepStepSizeDlg valueStepStepSizeDlg = new TxValueStepStepSizeDlg(TxValueStepType.Linear, this.TranslateStepValue);
    if (((Form) valueStepStepSizeDlg).ShowDialog() != DialogResult.OK)
      return;
    this.TranslateStepValue = valueStepStepSizeDlg.StepValue;
    TxFormSettings.StoreFormValue((Form) this, MlmStringTable.REGISTRY_TRANSLATION_VALUE, (object) (this.TranslateStepValue * TxApplication.Options.Units.LinearMultiplier).ToString());
  }

  private void InitializeApplyTranslationActions()
  {
    ButtonAction buttonAction1 = new ButtonAction(MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_NORMAL"), TxImageManager.GetImageByKey("Perpendicular"));
    ButtonAction buttonAction2 = new ButtonAction(MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_MOVEMENT"), TxImageManager.GetImageByKey("Approach"));
    ButtonAction buttonAction3 = new ButtonAction(MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_THIRD_AXIS"), TxImageManager.GetImageByKey("ThirdAxis"));
    this.txbcbApplyTranslationAxis.AddAction(buttonAction1);
    this.txbcbApplyTranslationAxis.AddAction(buttonAction2);
    this.txbcbApplyTranslationAxis.AddAction(buttonAction3);
    this.txbcbApplyTranslationAxis.SelectedAction = 0;
  }

  private void txbcbApplyTranslationAxis_FireAction(object sender, FireActionEventArgs args)
  {
    if (this._indexOfLeadingObjectInTheList < 0)
      return;
    ReferenceAxis selectedAxis = CApMlmSharedLogic.GetSelectedAxis(((Collection<ITxObject>) this.txOgObjects.Objects)[this._indexOfLeadingObjectInTheList] as ITxLocationOperation, args.Action);
    if (selectedAxis == null)
      this.rbX.Checked = true;
    else if (selectedAxis == 1)
    {
      this.rbY.Checked = true;
    }
    else
    {
      if (selectedAxis != 2)
        return;
      this.rbZ.Checked = true;
    }
  }

  private void btnApplyTranslateAxis_Click(object sender, EventArgs e)
  {
    if (this._indexOfLeadingObjectInTheList < 0)
      return;
    if (((Collection<ITxObject>) this.txOgObjects.Objects)[this._indexOfLeadingObjectInTheList] is TxWeldLocationOperation)
    {
      switch ((int) TxApplication.Options.Weld.Perpendicular)
      {
        case 0:
          this.rbX.Checked = true;
          break;
        case 1:
          this.rbY.Checked = true;
          break;
        case 2:
          this.rbZ.Checked = true;
          break;
      }
    }
    else
    {
      if (!(((Collection<ITxObject>) this.txOgObjects.Objects)[this._indexOfLeadingObjectInTheList] is TxRoboticSeamLocationOperation))
        return;
      switch ((int) TxApplication.Options.Continuous.Normal)
      {
        case 0:
        case 3:
          this.rbX.Checked = true;
          break;
        case 1:
        case 4:
          this.rbY.Checked = true;
          break;
        case 2:
        case 5:
          this.rbZ.Checked = true;
          break;
      }
    }
  }

  private void rbRx_CheckedChanged(object sender, EventArgs e)
  {
    this._rotateValue = 0.0;
    if (this.rbRx.Checked)
      this.rbX.Checked = this.rbY.Checked = this.rbZ.Checked = false;
    this.ClearLastLocationDeltas();
    this.SetEnabledCommandsOnDialog();
    this.SelectApplyAxisAction();
    this.UpdateListStatus();
    if (this._manipulateViaPlacement)
      return;
    this.Placement.SelectedAxis = (TxPlacementManipulatorElement) 2;
  }

  private void rbRy_CheckedChanged(object sender, EventArgs e)
  {
    this._rotateValue = 0.0;
    if (this.rbRy.Checked)
      this.rbX.Checked = this.rbY.Checked = this.rbZ.Checked = false;
    this.ClearLastLocationDeltas();
    this.SetEnabledCommandsOnDialog();
    this.SelectApplyAxisAction();
    this.UpdateListStatus();
    if (this._manipulateViaPlacement)
      return;
    this.Placement.SelectedAxis = (TxPlacementManipulatorElement) 5;
  }

  private void rbRz_CheckedChanged(object sender, EventArgs e)
  {
    this._rotateValue = 0.0;
    if (this.rbRz.Checked)
      this.rbX.Checked = this.rbY.Checked = this.rbZ.Checked = false;
    this.ClearLastLocationDeltas();
    this.SetEnabledCommandsOnDialog();
    this.SelectApplyAxisAction();
    this.UpdateListStatus();
    if (this._manipulateViaPlacement)
      return;
    this.Placement.SelectedAxis = (TxPlacementManipulatorElement) 8;
  }

  private void btnRotateLeft_ContinuousClick(object sender, EventArgs e)
  {
    this._wereChangesMade = true;
    double step = -1.0 * this._rotateStepValue;
    this.RotateClicked(double.Parse(this.tbRotateValue.Text), step);
  }

  private void btnRotateRight_ContinuousClick(object sender, EventArgs e)
  {
    this._wereChangesMade = true;
    double rotateStepValue = this._rotateStepValue;
    this.RotateClicked(double.Parse(this.tbRotateValue.Text), rotateStepValue);
  }

  private void RotateClicked(double oldValue, double step)
  {
    double newValue = oldValue + step;
    this.Rotate(oldValue, newValue, this.txOgObjects.Objects);
    this.tbRotateValue.Text = newValue.ToString("F" + TxApplication.Options.Units.AngularDigitsAfterDecimalPoint.ToString());
  }

  private void tbRotateValue_Enter(object sender, EventArgs e)
  {
    this._wasRotationProcessed = false;
    double.TryParse(this.tbRotateValue.Text, out this._rotationBeforeEdit);
  }

  private void tbRotateValue_Leave(object sender, EventArgs e)
  {
    if (this._wasRotationProcessed)
    {
      this._wasRotationProcessed = false;
    }
    else
    {
      double result = 0.0;
      if (double.TryParse(this.tbRotateValue.Text, out result))
      {
        this._wereChangesMade = true;
        this.Rotate(this._rotationBeforeEdit, result, this.txOgObjects.Objects);
        this.tbRotateValue.Text = result.ToString("F" + TxApplication.Options.Units.AngularDigitsAfterDecimalPoint.ToString());
      }
      else
      {
        this.tbRotateValue.Undo();
        this.tbRotateValue.Text = this._rotationBeforeEdit.ToString("F" + TxApplication.Options.Units.AngularDigitsAfterDecimalPoint.ToString());
      }
    }
  }

  private void tbRotateValue_KeyDown(object sender, KeyEventArgs e)
  {
    if (e.KeyCode != Keys.Return)
      return;
    double result = 0.0;
    if (double.TryParse(this.tbRotateValue.Text, out result))
    {
      this._wereChangesMade = true;
      this.Rotate(this._rotationBeforeEdit, result, this.txOgObjects.Objects);
      this.tbRotateValue.Text = result.ToString("F" + TxApplication.Options.Units.AngularDigitsAfterDecimalPoint.ToString());
    }
    else
    {
      this.tbRotateValue.Undo();
      this.tbRotateValue.Text = this._rotationBeforeEdit.ToString("F" + TxApplication.Options.Units.AngularDigitsAfterDecimalPoint.ToString());
    }
    this._wasRotationProcessed = true;
  }

  private void Rotate(
    double oldValue,
    double newValue,
    TxObjectList locations,
    bool updateStateOnRollback = true)
  {
    TxApplication.ActiveUndoManager.StartTransaction();
    foreach (ITxObject location in (Collection<ITxObject>) locations)
    {
      int num = ((Collection<ITxObject>) this.txOgObjects.Objects).IndexOf(location);
      ITxLocationOperation theLocation = location as ITxLocationOperation;
      double lastLocationDelta = this._lastLocationDelta[num];
      bool shouldFollowModeOnTheLocation = false;
      if (this._indexOfLeadingObjectInTheList > -1)
        shouldFollowModeOnTheLocation = theLocation == ((Collection<ITxObject>) this.txOgObjects.Objects)[this._indexOfLeadingObjectInTheList];
      TxAxis rotatingAxis = (TxAxis) 2;
      if (this.rbRx.Checked)
        rotatingAxis = (TxAxis) 0;
      else if (this.rbRy.Checked)
        rotatingAxis = (TxAxis) 1;
      else if (this.rbRz.Checked)
        rotatingAxis = (TxAxis) 2;
      TxTransformation currentReferenceFrame = this.GetCurrentReferenceFrame(num);
      TxTransformation absoluteLocation1 = (theLocation as ITxLocatableObject).AbsoluteLocation;
      LocationNewStatus newStatus = this._sharedLogic.Rotate(oldValue, newValue, rotatingAxis, ref theLocation, this._locationsStatus[num], ref lastLocationDelta, this.cbLimitOptions.Checked, this.cbRotateToMaximum.Checked, shouldFollowModeOnTheLocation, currentReferenceFrame);
      TxTransformation absoluteLocation2 = (theLocation as ITxLocatableObject).AbsoluteLocation;
      if (updateStateOnRollback || !absoluteLocation1.Equals((object) absoluteLocation2) || this._sharedLogic.LastGunAndRobotOnLocationState == CApMlmSharedLogic.eGunAndRobotOnLocationState.Success)
      {
        this._lastLocationDelta[num] = lastLocationDelta;
        this.UpdateStatus(num, newStatus);
      }
    }
    TxApplication.ActiveUndoManager.EndTransaction();
    this.RefreshFrameOfReferenceLocation();
    TxApplication.RefreshDisplay();
  }

  private void llRotateStep_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
  {
    TxValueStepStepSizeDlg valueStepStepSizeDlg = new TxValueStepStepSizeDlg(TxValueStepType.Angular, this.RotateStepValue);
    if (((Form) valueStepStepSizeDlg).ShowDialog() != DialogResult.OK)
      return;
    this.RotateStepValue = valueStepStepSizeDlg.StepValue;
    TxFormSettings.StoreFormValue((Form) this, MlmStringTable.REGISTRY_ROTATION_VALUE, (object) (this.RotateStepValue * TxApplication.Options.Units.AngularMultiplier).ToString());
  }

  private void InitializeApplyRotationActions()
  {
    ButtonAction buttonAction1 = new ButtonAction(MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_NORMAL"), TxImageManager.GetImageByKey("Perpendicular"));
    ButtonAction buttonAction2 = new ButtonAction(MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_MOVEMENT"), TxImageManager.GetImageByKey("Approach"));
    ButtonAction buttonAction3 = new ButtonAction(MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_THIRD_AXIS"), TxImageManager.GetImageByKey("ThirdAxis"));
    this.txbcbApplyRotationAxis.AddAction(buttonAction1);
    this.txbcbApplyRotationAxis.AddAction(buttonAction2);
    this.txbcbApplyRotationAxis.AddAction(buttonAction3);
    this.txbcbApplyRotationAxis.SelectedAction = 0;
  }

  private void txbcbApplyRotationAxis_FireAction(object sender, FireActionEventArgs args)
  {
    if (this._indexOfLeadingObjectInTheList < 0)
      return;
    ReferenceAxis selectedAxis = CApMlmSharedLogic.GetSelectedAxis(((Collection<ITxObject>) this.txOgObjects.Objects)[this._indexOfLeadingObjectInTheList] as ITxLocationOperation, args.Action);
    if (selectedAxis == null)
      this.rbRx.Checked = true;
    else if (selectedAxis == 1)
    {
      this.rbRy.Checked = true;
    }
    else
    {
      if (selectedAxis != 2)
        return;
      this.rbRz.Checked = true;
    }
  }

  private bool AreAllLocationsVia()
  {
    bool flag = true;
    foreach (ITxObject itxObject in (Collection<ITxObject>) this.txOgObjects.Objects)
    {
      if (!(itxObject is TxRoboticViaLocationOperation))
      {
        flag = false;
        break;
      }
    }
    return flag;
  }

  private void cbLimitOptions_CheckedChanged(object sender, EventArgs e)
  {
    if (!this.cbLimitOptions.Enabled)
      return;
    if (this.cbLimitOptions.Checked)
    {
      if (this._wereChangesMade && !this.AreAllLocationsVia())
      {
        if (TxMessageBox.Show(MlmStringTable.ResourceManager.GetString("MULTIPLE_LOCATIONS_MANIPULATION_RESET_WARNING_MESSAGE"), ((Control) this).Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
          this.DoReset();
        else
          this.cbLimitOptions.Checked = false;
      }
      this.UpdateListStatus();
    }
    else if (this.rbX.Checked)
      this.Translate(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, this.txOgObjects.Objects);
    else if (this.rbY.Checked)
      this.Translate(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, this.txOgObjects.Objects);
    else if (this.rbZ.Checked)
      this.Translate(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, this.txOgObjects.Objects);
    else if (this.rbRx.Checked || this.rbRy.Checked || this.rbRz.Checked)
      this.Rotate(0.0, 0.0, this.txOgObjects.Objects);
    if (!this.cbLimitOptions.Checked)
    {
      this.cbRotateToMaximum.Checked = false;
      this.cbRotateToMaximum.Enabled = false;
    }
    else
      this.cbRotateToMaximum.Enabled = true;
  }

  private void cbRotateToMaximum_CheckedChanged(object sender, EventArgs e)
  {
    if (!this.cbRotateToMaximum.Enabled || !this._wereChangesMade || this._cancelAction)
      return;
    if (TxMessageBox.Show(MlmStringTable.ResourceManager.GetString("MULTIPLE_LOCATIONS_MANIPULATION_RESET_WARNING_MESSAGE"), ((Control) this).Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
    {
      this.DoReset();
    }
    else
    {
      this._cancelAction = true;
      this.cbRotateToMaximum.Checked = !this.cbRotateToMaximum.Checked;
      this._cancelAction = false;
    }
  }

  private void btnReset_Click(object sender, EventArgs e) => this.DoReset(true);

  private void cbFollowMode_Click(object sender, EventArgs e)
  {
    CApMlmSharedLogic.SetActiveControlState(this.cbFollowMode);
    this._sharedLogic.FollowMode(this.cbFollowMode.Checked);
    this.RobotFollowMode();
  }

  public virtual void OnInitTxForm()
  {
    base.OnInitTxForm();
    Cursor current = Cursor.Current;
    Cursor.Current = Cursors.WaitCursor;
    this.InitStepValues();
    this.LoadCheckboxesValue();
    this.InitZeroValues();
    this.InitializeApplyRotationActions();
    this.InitializeApplyTranslationActions();
    this.InitLocationsList();
    this.GenerateSizeOfDialog();
    this.UpdateListStatus();
    this._sharedLogic.FillFrameComboBox(this.m_txFrameComboBoxCtrlRelative);
    Cursor.Current = current;
  }

  private void btnClose_Click(object sender, EventArgs e) => ((Form) this).Close();

  private void CCUiMlmMultipleLocationsManipulationDlg_FormClosing(
    object sender,
    FormClosingEventArgs e)
  {
    this._sharedLogic.DestroyGhostGun();
    this.Placement.Deactivate();
    this._sharedLogic.ShowConeManipulator = false;
    this._sharedLogic.Dispose();
    TxApplication.RefreshDisplay();
    this.SaveCheckboxesValue();
  }

  protected virtual bool ProcessTabKey(bool forward)
  {
    bool flag = false;
    // ISSUE: explicit non-virtual call
    if (__nonvirtual (((ContainerControl) this).ActiveControl) != null)
    {
      // ISSUE: explicit non-virtual call
      switch (__nonvirtual (((ContainerControl) this).ActiveControl).Name)
      {
        case "btnClose":
          if (!this._isShiftKeyPressed)
          {
            this.rbX.Checked = true;
            this.rbX.Focus();
            flag = true;
            break;
          }
          break;
        case "btnRotateLeft":
          if (this._isShiftKeyPressed)
          {
            this.rbRz.Checked = true;
            this.rbRz.Focus();
            break;
          }
          break;
        case "btnTranslateLeft":
          if (this._isShiftKeyPressed)
          {
            this.rbZ.Checked = true;
            this.rbZ.Focus();
            flag = true;
            break;
          }
          break;
        case "btnTranslateRight":
          if (!this._isShiftKeyPressed)
          {
            this.rbRx.Checked = true;
            this.rbRx.Focus();
            flag = true;
            break;
          }
          break;
        case "rbRx":
          if (this._isShiftKeyPressed)
          {
            this.rbZ.Checked = true;
            this.rbZ.Focus();
          }
          else
          {
            this.rbRy.Checked = true;
            this.rbRy.Focus();
          }
          flag = true;
          break;
        case "rbRy":
          if (this._isShiftKeyPressed)
          {
            this.rbRx.Checked = true;
            this.rbRx.Focus();
          }
          else
          {
            this.rbRz.Checked = true;
            this.rbRz.Focus();
          }
          flag = true;
          break;
        case "rbRz":
          if (this._isShiftKeyPressed)
          {
            this.rbRy.Checked = true;
            this.rbRy.Focus();
          }
          else
            ((Control) this.btnRotateLeft).Focus();
          flag = true;
          break;
        case "rbX":
          if (this._isShiftKeyPressed)
          {
            this.btnClose.Focus();
          }
          else
          {
            this.rbY.Checked = true;
            this.rbY.Focus();
          }
          flag = true;
          break;
        case "rbY":
          if (this._isShiftKeyPressed)
          {
            this.rbX.Checked = true;
            this.rbX.Focus();
          }
          else
          {
            this.rbZ.Checked = true;
            this.rbZ.Focus();
          }
          flag = true;
          break;
        case "rbZ":
          if (this._isShiftKeyPressed)
          {
            this.rbY.Checked = true;
            this.rbY.Focus();
          }
          else
            ((Control) this.btnTranslateLeft).Focus();
          flag = true;
          break;
        default:
          flag = false;
          break;
      }
    }
    return flag || base.ProcessTabKey(forward);
  }

  private void GenerateSizeOfDialog()
  {
    if (((Collection<ITxObject>) this.txOgObjects.Objects).Count == 1)
      ((Control) this).Height = 411;
    else
      ((Control) this).Height = 493;
  }

  private void InitLocationsList()
  {
    // ISSUE: unable to decompile the method.
  }

  private void AddObjectCollectionToObjectsList(ITxOrderedObjectCollection locationCollection)
  {
    for (int index = 0; index < ((ITxObjectCollection) locationCollection).Count; ++index)
    {
      if (locationCollection.GetChildAt(index) is ITxLocationOperation)
      {
        ITxObject childAt = locationCollection.GetChildAt(index);
        if (!((Collection<ITxObject>) this.txOgObjects.Objects).Contains(childAt))
        {
          try
          {
            if (this.CanManipulateArcLocations(childAt as ITxRoboticLocationOperation) && this.CanManipulateWeldLocations(childAt as ITxRoboticLocationOperation))
              this.txOgObjects.AppendObject(childAt);
          }
          catch (Exception ex)
          {
          }
        }
      }
      else if (locationCollection.GetChildAt(index) is ITxOrderedObjectCollection childAt1)
        this.AddObjectCollectionToObjectsList(childAt1);
    }
  }

  private void txOgObjects_ObjectInserted(object sender, TxObjGridCtrl_ObjectInsertedEventArgs args)
  {
    TxTransformation txTransformation1 = (TxTransformation) null;
    TxTransformation txTransformation2 = (TxTransformation) null;
    if (!this._insertingMultipleLocs)
      this._arcLocationsWarningMessageWasDisplayed = false;
    if (this.CanManipulateArcLocations(args.Obj as ITxRoboticLocationOperation) && this.CanManipulateWeldLocations(args.Obj as ITxRoboticLocationOperation) && args.Obj is ITxLocationOperation)
    {
      txTransformation1 = new TxTransformation((args.Obj as ITxLocatableObject).AbsoluteLocation);
      if (args.Obj is TxWeldLocationOperation)
        txTransformation2 = new TxTransformation((args.Obj as TxWeldLocationOperation).ProjectedLocation);
      else if (args.Obj is TxRoboticSeamLocationOperation)
        txTransformation2 = new TxTransformation((args.Obj as TxRoboticSeamLocationOperation).ProjectedLocation);
    }
    else
      this.txOgObjects.DeleteRow(args.Row);
    if (!TxTransformation.op_Inequality(txTransformation1, (TxTransformation) null))
      return;
    this._locationTransformation.Add(new Tuple<TxTransformation, TxTransformation>(txTransformation1, txTransformation2));
    this._locationsStatus.Add((LocationNewStatus) 0);
    this._lastLocationDelta.Add(0.0);
    this.txOgObjects.SetBitmapValue(args.Row, 2, (TxGridBitmapType) 3);
    this.UpdateLocationStatus(args.Row);
    this.UpdateLocationIcon(args.Row);
    this.ChangeSelection(args.Row);
  }

  private void txOgObjects_ObjectDeleting(object sender, TxObjGridCtrl_ObjectDeletingEventArgs args)
  {
    if (((Collection<ITxObject>) this.txOgObjects.SelectedObjects).Count <= 0)
      return;
    if (((Collection<ITxObject>) this.txOgObjects.SelectedObjects).Count > 1)
    {
      this._pauseDisplayRefresh = true;
    }
    else
    {
      this._pauseDisplayRefresh = false;
      this.RefreshManipulatorDisplay();
    }
    if (((Collection<ITxObject>) this.txOgObjects.Objects)[args.Row] is ITxLocatableObject)
    {
      this._locationTransformation.RemoveAt(args.Row);
      this._locationsStatus.RemoveAt(args.Row);
      this._lastLocationDelta.RemoveAt(args.Row);
    }
    if (args.Row != this._indexOfLeadingObjectInTheList)
      return;
    this.Placement.Deactivate();
  }

  private void txOgObjects_Picked(object sender, TxObjGridCtrl_PickedEventArgs args)
  {
    Cursor current = Cursor.Current;
    Cursor.Current = Cursors.WaitCursor;
    this._pauseDisplayRefresh = true;
    if (args.Obj is ITxOrderedObjectCollection)
    {
      ITxOrderedObjectCollection locationCollection = args.Obj as ITxOrderedObjectCollection;
      this._insertingMultipleLocs = true;
      this._arcLocationsWarningMessageWasDisplayed = false;
      this.AddObjectCollectionToObjectsList(locationCollection);
      this._insertingMultipleLocs = false;
      this._arcLocationsWarningMessageWasDisplayed = false;
    }
    Cursor.Current = current;
    this._pauseDisplayRefresh = false;
  }

  private void ChangeSelection(int topArg)
  {
    Cursor current = Cursor.Current;
    Cursor.Current = Cursors.WaitCursor;
    if (!this._pauseDisplayRefresh)
    {
      try
      {
        TxApplication.ActiveSelection.Clear();
        this._sharedLogic.Location = (ITxLocationOperation) null;
        this._projectedLocation = (TxTransformation) null;
        bool canCreateFrame = false;
        if (((Collection<ITxObject>) this.txOgObjects.Objects).Count > topArg && topArg >= 0)
        {
          this.SetProjectedLocation(topArg);
          canCreateFrame = this.IsWeldOrSeamLocationOperation(((Collection<ITxObject>) this.txOgObjects.Objects)[topArg] as ITxLocationOperation);
          this._indexOfLeadingObjectInTheList = topArg;
          this.RefreshManipulatorDisplay();
          TxObjectList txObjectList = new TxObjectList();
          ((Collection<ITxObject>) txObjectList).Add(((Collection<ITxObject>) this.txOgObjects.Objects)[topArg]);
          TxApplication.ActiveSelection.AddItems(txObjectList);
          this._sharedLogic.Location = ((Collection<ITxObject>) this.txOgObjects.Objects)[this._indexOfLeadingObjectInTheList] as ITxLocationOperation;
        }
        else
        {
          if (this.Placement != null)
            this.Placement.Deactivate();
          this._indexOfLeadingObjectInTheList = -1;
        }
        if (this.m_eachRelativeToOriginalProjectionRdBtn.Checked)
          this._sharedLogic.UpdateProjectionFrame(canCreateFrame, this._projectedLocation);
      }
      catch (Exception ex)
      {
        if (this.Placement != null)
          this.Placement.Deactivate();
        this._indexOfLeadingObjectInTheList = -1;
      }
      this.EnableOrDisableControlsForSelectedLocation();
      this.RobotFollowMode();
      TxApplication.RefreshDisplay();
    }
    Cursor.Current = current;
  }

  private void SelectApplyAxisAction()
  {
    if (this._indexOfLeadingObjectInTheList < 0)
      return;
    Dictionary<ReferenceAxis, string> dictionary = new Dictionary<ReferenceAxis, string>();
    if (((Collection<ITxObject>) this.txOgObjects.Objects)[this._indexOfLeadingObjectInTheList] is TxWeldLocationOperation)
    {
      ReferenceAxis selectedAxis1 = CApMlmSharedLogic.GetSelectedAxis(((Collection<ITxObject>) this.txOgObjects.Objects)[this._indexOfLeadingObjectInTheList] as ITxLocationOperation, MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_PERPENDICULAR"));
      ReferenceAxis selectedAxis2 = CApMlmSharedLogic.GetSelectedAxis(((Collection<ITxObject>) this.txOgObjects.Objects)[this._indexOfLeadingObjectInTheList] as ITxLocationOperation, MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_APPROACH"));
      ReferenceAxis selectedAxis3 = CApMlmSharedLogic.GetSelectedAxis(((Collection<ITxObject>) this.txOgObjects.Objects)[this._indexOfLeadingObjectInTheList] as ITxLocationOperation, MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_THIRD_AXIS"));
      dictionary.Add(selectedAxis1, MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_PERPENDICULAR"));
      dictionary.Add(selectedAxis2, MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_APPROACH"));
      dictionary.Add(selectedAxis3, MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_THIRD_AXIS"));
    }
    else if (((Collection<ITxObject>) this.txOgObjects.Objects)[this._indexOfLeadingObjectInTheList] is TxRoboticSeamLocationOperation)
    {
      ReferenceAxis selectedAxis4 = CApMlmSharedLogic.GetSelectedAxis(((Collection<ITxObject>) this.txOgObjects.Objects)[this._indexOfLeadingObjectInTheList] as ITxLocationOperation, MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_NORMAL"));
      ReferenceAxis selectedAxis5 = CApMlmSharedLogic.GetSelectedAxis(((Collection<ITxObject>) this.txOgObjects.Objects)[this._indexOfLeadingObjectInTheList] as ITxLocationOperation, MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_MOVEMENT"));
      ReferenceAxis selectedAxis6 = CApMlmSharedLogic.GetSelectedAxis(((Collection<ITxObject>) this.txOgObjects.Objects)[this._indexOfLeadingObjectInTheList] as ITxLocationOperation, MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_THIRD_AXIS"));
      dictionary.Add(selectedAxis4, MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_NORMAL"));
      dictionary.Add(selectedAxis5, MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_MOVEMENT"));
      dictionary.Add(selectedAxis6, MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_THIRD_AXIS"));
    }
    if (dictionary == null || dictionary.Count <= 0)
      return;
    if (this.rbX.Checked)
      this.txbcbApplyTranslationAxis.SelectActionWithoutEventFire(this.txbcbApplyTranslationAxis.IndexOfAction(dictionary[(ReferenceAxis) 0]));
    else if (this.rbY.Checked)
      this.txbcbApplyTranslationAxis.SelectActionWithoutEventFire(this.txbcbApplyTranslationAxis.IndexOfAction(dictionary[(ReferenceAxis) 1]));
    else if (this.rbZ.Checked)
      this.txbcbApplyTranslationAxis.SelectActionWithoutEventFire(this.txbcbApplyTranslationAxis.IndexOfAction(dictionary[(ReferenceAxis) 2]));
    else if (this.rbRx.Checked)
      this.txbcbApplyRotationAxis.SelectActionWithoutEventFire(this.txbcbApplyTranslationAxis.IndexOfAction(dictionary[(ReferenceAxis) 0]));
    else if (this.rbRy.Checked)
    {
      this.txbcbApplyRotationAxis.SelectActionWithoutEventFire(this.txbcbApplyTranslationAxis.IndexOfAction(dictionary[(ReferenceAxis) 1]));
    }
    else
    {
      if (!this.rbRz.Checked)
        return;
      this.txbcbApplyRotationAxis.SelectActionWithoutEventFire(this.txbcbApplyTranslationAxis.IndexOfAction(dictionary[(ReferenceAxis) 2]));
    }
  }

  private void EnableOrDisableControlsForSelectedLocation()
  {
    if (this._indexOfLeadingObjectInTheList >= 0 && !(((Collection<ITxObject>) this.txOgObjects.Objects)[this._indexOfLeadingObjectInTheList] is TxRoboticViaLocationOperation) && !(((Collection<ITxObject>) this.txOgObjects.Objects)[this._indexOfLeadingObjectInTheList] is TxGenericRoboticLocationOperation) && !(((Collection<ITxObject>) this.txOgObjects.Objects)[this._indexOfLeadingObjectInTheList] is TxObjectFlowLocationOperation))
    {
      ((Control) this.txbcbApplyTranslationAxis).Enabled = true;
      ((Control) this.txbcbApplyRotationAxis).Enabled = true;
      this.SetIndexOfSelectedAxis();
      this.txbcbApplyRotationAxis.RemoveAction(MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_NORMAL"));
      this.txbcbApplyRotationAxis.RemoveAction(MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_APPROACH"));
      this.txbcbApplyRotationAxis.RemoveAction(MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_PERPENDICULAR"));
      this.txbcbApplyRotationAxis.RemoveAction(MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_MOVEMENT"));
      this.txbcbApplyRotationAxis.RemoveAction(MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_THIRD_AXIS"));
      this.txbcbApplyTranslationAxis.RemoveAction(MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_NORMAL"));
      this.txbcbApplyTranslationAxis.RemoveAction(MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_APPROACH"));
      this.txbcbApplyTranslationAxis.RemoveAction(MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_PERPENDICULAR"));
      this.txbcbApplyTranslationAxis.RemoveAction(MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_MOVEMENT"));
      this.txbcbApplyTranslationAxis.RemoveAction(MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_THIRD_AXIS"));
      if (((Collection<ITxObject>) this.txOgObjects.Objects)[this._indexOfLeadingObjectInTheList] is TxWeldLocationOperation)
      {
        ButtonAction buttonAction1 = new ButtonAction(MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_PERPENDICULAR"), TxImageManager.GetImageByKey("Perpendicular"));
        ButtonAction buttonAction2 = new ButtonAction(MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_APPROACH"), TxImageManager.GetImageByKey("Approach"));
        ButtonAction buttonAction3 = new ButtonAction(MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_THIRD_AXIS"), TxImageManager.GetImageByKey("ThirdAxis"));
        this.txbcbApplyRotationAxis.AddAction(buttonAction1);
        this.txbcbApplyRotationAxis.AddAction(buttonAction2);
        this.txbcbApplyRotationAxis.AddAction(buttonAction3);
        this.txbcbApplyTranslationAxis.AddAction(buttonAction1);
        this.txbcbApplyTranslationAxis.AddAction(buttonAction2);
        this.txbcbApplyTranslationAxis.AddAction(buttonAction3);
      }
      else if (((Collection<ITxObject>) this.txOgObjects.Objects)[this._indexOfLeadingObjectInTheList] is TxRoboticSeamLocationOperation)
      {
        ButtonAction buttonAction4 = new ButtonAction(MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_NORMAL"), TxImageManager.GetImageByKey("Perpendicular"));
        ButtonAction buttonAction5 = new ButtonAction(MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_MOVEMENT"), TxImageManager.GetImageByKey("Approach"));
        ButtonAction buttonAction6 = new ButtonAction(MlmStringTable.ResourceManager.GetString("MLM_APPLY_ROTATION_AXIS_THIRD_AXIS"), TxImageManager.GetImageByKey("ThirdAxis"));
        this.txbcbApplyRotationAxis.AddAction(buttonAction4);
        this.txbcbApplyRotationAxis.AddAction(buttonAction5);
        this.txbcbApplyRotationAxis.AddAction(buttonAction6);
        this.txbcbApplyTranslationAxis.AddAction(buttonAction4);
        this.txbcbApplyTranslationAxis.AddAction(buttonAction5);
        this.txbcbApplyTranslationAxis.AddAction(buttonAction6);
      }
      this.SelectAxis();
      this.SelectApplyAxisAction();
    }
    else
    {
      ((Control) this.txbcbApplyTranslationAxis).Enabled = false;
      ((Control) this.txbcbApplyRotationAxis).Enabled = false;
      if (this.rbX.Checked)
      {
        this.rbZ.Checked = true;
        this.rbX.Checked = true;
      }
      else if (this.rbY.Checked)
      {
        this.rbX.Checked = true;
        this.rbY.Checked = true;
      }
      else if (this.rbZ.Checked)
      {
        this.rbX.Checked = true;
        this.rbZ.Checked = true;
      }
      else if (this.rbRx.Checked)
      {
        this.rbRz.Checked = true;
        this.rbRx.Checked = true;
      }
      else if (this.rbRy.Checked)
      {
        this.rbRx.Checked = true;
        this.rbRy.Checked = true;
      }
      else
      {
        if (!this.rbRz.Checked)
          return;
        this.rbRx.Checked = true;
        this.rbRz.Checked = true;
      }
    }
  }

  private void SelectAxis()
  {
    if (this._indexOfSelectedAxis == 0)
      this.rbX.Checked = true;
    else if (this._indexOfSelectedAxis == 1)
      this.rbY.Checked = true;
    else if (this._indexOfSelectedAxis == 2)
      this.rbZ.Checked = true;
    else if (this._indexOfSelectedAxis == 3)
      this.rbRx.Checked = true;
    else if (this._indexOfSelectedAxis == 4)
    {
      this.rbRy.Checked = true;
    }
    else
    {
      if (this._indexOfSelectedAxis != 5)
        return;
      this.rbRz.Checked = true;
    }
  }

  private void SetIndexOfSelectedAxis()
  {
    if (this.rbX.Checked)
      this._indexOfSelectedAxis = 0;
    else if (this.rbY.Checked)
      this._indexOfSelectedAxis = 1;
    else if (this.rbZ.Checked)
      this._indexOfSelectedAxis = 2;
    else if (this.rbRx.Checked)
      this._indexOfSelectedAxis = 3;
    else if (this.rbRy.Checked)
    {
      this._indexOfSelectedAxis = 4;
    }
    else
    {
      if (!this.rbRz.Checked)
        return;
      this._indexOfSelectedAxis = 5;
    }
  }

  private int GetIndexOfSelectedAxis() => this._indexOfSelectedAxis;

  private void OnGridSelectionChanged(int topArg)
  {
    this._sharedLogic.FollowMode(this.cbFollowMode.Checked);
    this._sharedLogic.GraphicsRefresh();
    this.ChangeSelection(topArg);
    ((ToolStripItem) this.tsbShowCone).Enabled = this._sharedLogic.CanHaveProjection();
    if (!((ToolStripButton) this.tsbShowCone).Checked)
      return;
    this._sharedLogic.ZoomToSelection();
  }

  private void txOgObjects_SelectionChanged(
    object sender,
    TxObjGridCtrl_SelectionChangedEventArgs args)
  {
    this.OnGridSelectionChanged(args.Top);
  }

  public void UpdateStatus(int indexOfTransformation, LocationNewStatus newStatus)
  {
    this._locationsStatus[indexOfTransformation] = newStatus;
    if (newStatus == null)
    {
      this.txOgObjects.SetBitmapValue(indexOfTransformation, 2, (TxGridBitmapType) 0);
      this.txOgObjects.SetCellToolTip(indexOfTransformation, 2, MlmStringTable.MLM_PROJECTION_RESULT_SUCCESS);
    }
    else if (newStatus == 2)
    {
      this.txOgObjects.SetBitmapValue(indexOfTransformation, 2, (TxGridBitmapType) 1);
      this.txOgObjects.SetCellToolTip(indexOfTransformation, 2, MlmStringTable.MLM_PROJECTION_RESULT_LIMIT);
    }
    else if (newStatus == 1)
    {
      this.txOgObjects.SetBitmapValue(indexOfTransformation, 2, (TxGridBitmapType) 2);
      this.txOgObjects.SetCellToolTip(indexOfTransformation, 2, MlmStringTable.MLM_PROJECTION_RESULT_FAIL);
    }
    else
    {
      this.txOgObjects.SetBitmapValue(indexOfTransformation, 2, (TxGridBitmapType) 3);
      this.txOgObjects.SetCellToolTip(indexOfTransformation, 2, string.Empty);
    }
  }

  private void UpdateLocationStatus(int locationIndex)
  {
    LocationNewStatus newStatus = (LocationNewStatus) 0;
    CApMlmLocationsValidation locationsValidation = new CApMlmLocationsValidation(((Collection<ITxObject>) this.txOgObjects.Objects)[locationIndex], this.cbLimitOptions.Checked, this.cbRotateToMaximum.Checked);
    if (((Collection<ITxObject>) this.txOgObjects.Objects)[locationIndex] is TxWeldLocationOperation)
    {
      TxWeldLocationOperation locationOperation = ((Collection<ITxObject>) this.txOgObjects.Objects)[locationIndex] as TxWeldLocationOperation;
      newStatus = locationsValidation.GetLocationStatus();
    }
    else if (((Collection<ITxObject>) this.txOgObjects.Objects)[locationIndex] is TxRoboticViaLocationOperation)
    {
      TxRoboticViaLocationOperation locationOperation = ((Collection<ITxObject>) this.txOgObjects.Objects)[locationIndex] as TxRoboticViaLocationOperation;
      newStatus = (LocationNewStatus) 0;
    }
    else if (((Collection<ITxObject>) this.txOgObjects.Objects)[locationIndex] is TxRoboticSeamLocationOperation)
    {
      TxRoboticSeamLocationOperation locationOperation = ((Collection<ITxObject>) this.txOgObjects.Objects)[locationIndex] as TxRoboticSeamLocationOperation;
      newStatus = locationsValidation.GetLocationStatus();
    }
    this.UpdateStatus(locationIndex, newStatus);
  }

  private void UpdateListStatus()
  {
    for (int locationIndex = 0; locationIndex < ((Collection<ITxObject>) this.txOgObjects.Objects).Count; ++locationIndex)
      this.UpdateLocationStatus(locationIndex);
  }

  private void UpdateLocationIcon(int locationIndex)
  {
    string str = string.Empty;
    if (((Collection<ITxObject>) this.txOgObjects.Objects)[locationIndex] is TxWeldLocationOperation)
      str = MlmStringTable.MLM_WELD_LOCATION;
    else if (((Collection<ITxObject>) this.txOgObjects.Objects)[locationIndex] is TxRoboticViaLocationOperation)
      str = MlmStringTable.MLM_VIA_LOCATION;
    else if (((Collection<ITxObject>) this.txOgObjects.Objects)[locationIndex] is TxObjectFlowLocationOperation)
      str = MlmStringTable.MLM_OBJECT_FLOW_LOCATION;
    else if (((Collection<ITxObject>) this.txOgObjects.Objects)[locationIndex] is TxRoboticSeamLocationOperation)
      str = MlmStringTable.MLM_SEAM_LOCATION;
    else if (((Collection<ITxObject>) this.txOgObjects.Objects)[locationIndex] is TxGenericRoboticLocationOperation)
      str = MlmStringTable.MLM_GENERIC_LOCATION;
    if (!(str != string.Empty))
      return;
    Image objectIcon = TxIconManager.the().GetObjectIcon(((Collection<ITxObject>) this.txOgObjects.Objects)[locationIndex]);
    this.txOgObjects.SetCellBitmap(locationIndex, 0, (Bitmap) objectIcon);
    this.txOgObjects.SetCellToolTip(locationIndex, 0, str);
  }

  private void DoReset() => this.DoReset(false);

  private void DoReset(bool includeViaLocations)
  {
    this._sharedLogic.ResetGunAndRobotPose();
    TxApplication.ActiveUndoManager.StartTransaction();
    for (int index = 0; index < ((Collection<ITxObject>) this.txOgObjects.Objects).Count; ++index)
    {
      if (!(((Collection<ITxObject>) this.txOgObjects.Objects)[index] is TxRoboticViaLocationOperation) | includeViaLocations)
      {
        TxTransformation txTransformation1 = this._locationTransformation[index].Item1;
        TxTransformation txTransformation2 = this._locationTransformation[index].Item2;
        if (((Collection<ITxObject>) this.txOgObjects.Objects)[index] is TxWeldLocationOperation)
          (((Collection<ITxObject>) this.txOgObjects.Objects)[index] as TxWeldLocationOperation).ProjectedLocation = txTransformation2;
        else if (((Collection<ITxObject>) this.txOgObjects.Objects)[index] is TxRoboticSeamLocationOperation)
          TxRoboticSeamLocationOperationEx.SetProjectedLocation(((Collection<ITxObject>) this.txOgObjects.Objects)[index] as TxRoboticSeamLocationOperation, txTransformation2);
        (((Collection<ITxObject>) this.txOgObjects.Objects)[index] as ITxLocatableObject).AbsoluteLocation = new TxTransformation(txTransformation1.Translation, txTransformation1.RotationRPY_XYZ, (TxTransformation.TxRotationType) 1);
      }
    }
    this._translateValue = 0.0;
    this._rotateValue = 0.0;
    this._wereChangesMade = false;
    this.InitZeroValues();
    this.rbX.Checked = true;
    this.ClearLastLocationDeltas();
    this.UpdateListStatus();
    this.RobotFollowMode();
    this.RefreshFrameOfReferenceLocation();
    this._sharedLogic.GraphicsRefresh();
    TxApplication.ActiveUndoManager.EndTransaction();
  }

  private void ClearLastLocationDeltas()
  {
    for (int index = 0; index < this._lastLocationDelta.Count; ++index)
      this._lastLocationDelta[index] = 0.0;
  }

  private void CheckShift(object sender, KeyEventArgs e)
  {
    if (e.Shift)
      this._isShiftKeyPressed = true;
    else
      this._isShiftKeyPressed = false;
  }

  private void SetEnabledCommandsOnDialog()
  {
    if (this.rbX.Checked || this.rbY.Checked || this.rbZ.Checked)
    {
      ((Control) this.btnRotateLeft).Enabled = false;
      ((Control) this.btnRotateRight).Enabled = false;
      this.tbRotateValue.Enabled = false;
      ((Control) this.btnTranslateLeft).Enabled = true;
      ((Control) this.btnTranslateRight).Enabled = true;
      this.tbTranslateValue.Enabled = true;
      this.tbTranslateValue.Text = this._translateValue.ToString("F" + TxApplication.Options.Units.LinearDigitsAfterDecimalPoint.ToString());
    }
    else if (this.rbRx.Checked || this.rbRy.Checked || this.rbRz.Checked)
    {
      ((Control) this.btnRotateLeft).Enabled = true;
      ((Control) this.btnRotateRight).Enabled = true;
      this.tbRotateValue.Enabled = true;
      ((Control) this.btnTranslateLeft).Enabled = false;
      ((Control) this.btnTranslateRight).Enabled = false;
      this.tbTranslateValue.Enabled = false;
      this.tbRotateValue.Text = this._rotateValue.ToString("F" + TxApplication.Options.Units.AngularDigitsAfterDecimalPoint.ToString());
    }
    else
    {
      ((Control) this.btnRotateLeft).Enabled = false;
      ((Control) this.btnRotateRight).Enabled = false;
      this.tbRotateValue.Enabled = false;
      ((Control) this.btnTranslateLeft).Enabled = false;
      ((Control) this.btnTranslateRight).Enabled = false;
      this.tbTranslateValue.Enabled = false;
      this.tbTranslateValue.Text = this._translateValue.ToString("F" + TxApplication.Options.Units.LinearDigitsAfterDecimalPoint.ToString());
      this.tbRotateValue.Text = this._rotateValue.ToString("F" + TxApplication.Options.Units.AngularDigitsAfterDecimalPoint.ToString());
    }
  }

  private void SaveCheckboxesValue()
  {
    ResourceManager resourceManager = new ResourceManager("DnProcessSimulateCommands.MultipleLocationsManipulation.MlmStringTable", ((object) this).GetType().Assembly);
    string str1 = resourceManager.GetString("REGISTRY_LIMIT_LOCATIONS");
    string str2 = resourceManager.GetString("REGISTRY_ROTATE_TO_MAXIMUM_ALLOWED_LIMITATIONS");
    string str3 = resourceManager.GetString("REGISTRY_FOLLOW_MODE_VALUE");
    bool flag1 = this.cbLimitOptions.Checked;
    bool flag2 = this.cbRotateToMaximum.Checked;
    bool flag3 = this.cbFollowMode.Checked;
    TxFormSettings.StoreFormValue((Form) this, str1, (object) flag1);
    TxFormSettings.StoreFormValue((Form) this, str2, (object) flag2);
    TxFormSettings.StoreFormValue((Form) this, str3, (object) flag3);
  }

  private void LoadCheckboxesValue()
  {
    ResourceManager resourceManager = new ResourceManager("DnProcessSimulateCommands.MultipleLocationsManipulation.MlmStringTable", ((object) this).GetType().Assembly);
    string vlaueName1 = resourceManager.GetString("REGISTRY_LIMIT_LOCATIONS");
    string vlaueName2 = resourceManager.GetString("REGISTRY_ROTATE_TO_MAXIMUM_ALLOWED_LIMITATIONS");
    string vlaueName3 = resourceManager.GetString("REGISTRY_FOLLOW_MODE_VALUE");
    this.cbLimitOptions.Checked = CApMlmSharedLogic.GetBoolValueFromRegistry((Form) this, vlaueName1);
    this.cbRotateToMaximum.Checked = CApMlmSharedLogic.GetBoolValueFromRegistry((Form) this, vlaueName2);
    this.cbFollowMode.Checked = CApMlmSharedLogic.GetBoolValueFromRegistry((Form) this, vlaueName3);
    CApMlmSharedLogic.SetActiveControlState(this.cbFollowMode);
    this.RobotFollowMode();
  }

  private void InitStepValues()
  {
    ResourceManager resourceManager = new ResourceManager("DnProcessSimulateCommands.MultipleLocationsManipulation.MlmStringTable", ((object) this).GetType().Assembly);
    string str1 = resourceManager.GetString("REGISTRY_TRANSLATION_VALUE");
    string str2 = resourceManager.GetString("REGISTRY_ROTATION_VALUE");
    object obj = (object) null;
    TxFormSettings.RestoreFormValue((Form) this, str1, ref obj);
    if (obj != null)
    {
      try
      {
        this._translateStepValue = double.Parse(obj.ToString());
      }
      catch
      {
      }
    }
    TxFormSettings.RestoreFormValue((Form) this, str2, ref obj);
    if (obj != null)
    {
      try
      {
        this._rotateStepValue = double.Parse(obj.ToString());
      }
      catch
      {
      }
    }
    this._translateStepValue /= TxApplication.Options.Units.LinearMultiplier;
    this._translateStepValue = double.Parse(this._translateStepValue.ToString("F" + TxApplication.Options.Units.LinearDigitsAfterDecimalPoint.ToString()));
    this._rotateStepValue /= TxApplication.Options.Units.AngularMultiplier;
    this._rotateStepValue = double.Parse(this._rotateStepValue.ToString("F" + TxApplication.Options.Units.AngularDigitsAfterDecimalPoint.ToString()));
    this.SetStepValues();
  }

  private void SetStepValues()
  {
    string str = string.Format(MlmStringTable.MLM_STEP_SIZE_CAPTION, (object) this._rotateStepValue.ToString("F" + TxApplication.Options.Units.AngularDigitsAfterDecimalPoint.ToString()), (object) TxApplication.Options.Units.AngularUnitName);
    ((Control) this.llTranslateStep).Text = string.Format(MlmStringTable.MLM_STEP_SIZE_CAPTION, (object) this._translateStepValue.ToString("F" + TxApplication.Options.Units.LinearDigitsAfterDecimalPoint.ToString()), (object) TxApplication.Options.Units.LinearUnitName);
    ((Control) this.llRotateStep).Text = str;
  }

  private void InitZeroValues()
  {
    double num = 0.0;
    this.tbTranslateValue.Text = num.ToString("F" + TxApplication.Options.Units.LinearDigitsAfterDecimalPoint.ToString());
    this.tbRotateValue.Text = num.ToString("F" + TxApplication.Options.Units.AngularDigitsAfterDecimalPoint.ToString());
  }

  private bool IsArcLocation(ITxRoboticLocationOperation location)
  {
    return location != null && ((ITxObject) location).Collection is TxRoboticSeamOperation && TxProjectionEx.WasSeamOperationProjectedAsARC(((ITxObject) location).Collection as TxRoboticSeamOperation);
  }

  private bool CanManipulateArcLocations(ITxRoboticLocationOperation location)
  {
    if (location == null || !this.IsArcLocation(location))
      return true;
    if (!this._arcLocationsWarningMessageWasDisplayed)
    {
      this._allowManipulatingArcLocations = TxMessageBox.Show(MlmStringTable.ResourceManager.GetString("MLM_ARC_SEAM_LOCATION_WARNING_MESSAGE"), MlmStringTable.ResourceManager.GetString("MLM_ARC_SEAM_LOCATION_WARNING_TITLE"), MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes;
      this._arcLocationsWarningMessageWasDisplayed = true;
    }
    return this._allowManipulatingArcLocations;
  }

  private bool CanManipulateWeldLocations(ITxRoboticLocationOperation location)
  {
    bool flag = true;
    if (location is TxWeldLocationOperation)
      flag = (location as TxWeldLocationOperation).IsProjected;
    if (location is TxWeldLocationOperation && TxApplication.PlatformMode == 2)
      flag = false;
    return flag;
  }

  private List<ITxRoboticLocationOperation> TxObjectListToList(TxObjectList locationsObjs)
  {
    List<ITxRoboticLocationOperation> list = new List<ITxRoboticLocationOperation>();
    foreach (ITxObject locationsObj in (Collection<ITxObject>) locationsObjs)
    {
      if (locationsObj is ITxRoboticLocationOperation)
        list.Add(locationsObj as ITxRoboticLocationOperation);
    }
    return list;
  }

  public void UpdateTranslationOrRotationValue(TxTransformation deltaTransformation)
  {
    int num1 = 0;
    int num2 = 0;
    if (!TxDoubleExtension.AlmostEquals(deltaTransformation.Translation.X, 0.0))
      ++num1;
    if (!TxDoubleExtension.AlmostEquals(deltaTransformation.Translation.Y, 0.0))
      ++num1;
    if (!TxDoubleExtension.AlmostEquals(deltaTransformation.Translation.Z, 0.0))
      ++num1;
    if (!TxDoubleExtension.AlmostEquals(deltaTransformation.RotationRPY_XYZ.X, 0.0))
      ++num2;
    if (!TxDoubleExtension.AlmostEquals(deltaTransformation.RotationRPY_XYZ.Y, 0.0))
      ++num2;
    if (!TxDoubleExtension.AlmostEquals(deltaTransformation.RotationRPY_XYZ.Z, 0.0))
      ++num2;
    if (num1 == 0 && num2 == 0)
      return;
    if (!TxDoubleExtension.AlmostEquals(deltaTransformation.Translation.X, 0.0) || !TxDoubleExtension.AlmostEquals(deltaTransformation.Translation.Y, 0.0) || !TxDoubleExtension.AlmostEquals(deltaTransformation.Translation.Z, 0.0))
    {
      double oldValueX = 0.0;
      double oldValueY = 0.0;
      double oldValueZ = 0.0;
      double newValueX = 0.0;
      double newValueY = 0.0;
      double newValueZ = 0.0;
      if (num1 > 1 || this.Placement.IsPlaneSelected)
      {
        this.rbX.Checked = this.rbY.Checked = this.rbZ.Checked = false;
        this.rbRx.Checked = this.rbRy.Checked = this.rbRz.Checked = false;
        newValueX = deltaTransformation.Translation.X / TxApplication.Options.Units.LinearMultiplier;
        newValueY = deltaTransformation.Translation.Y / TxApplication.Options.Units.LinearMultiplier;
        newValueZ = deltaTransformation.Translation.Z / TxApplication.Options.Units.LinearMultiplier;
      }
      else if (!TxDoubleExtension.AlmostEquals(deltaTransformation.Translation.X, 0.0))
      {
        if (!this.rbX.Checked)
          this.rbX.Checked = true;
        oldValueX = double.Parse(this.tbTranslateValue.Text);
        newValueX = oldValueX + deltaTransformation.Translation.X / TxApplication.Options.Units.LinearMultiplier;
      }
      else if (!TxDoubleExtension.AlmostEquals(deltaTransformation.Translation.Y, 0.0))
      {
        if (!this.rbY.Checked)
          this.rbY.Checked = true;
        oldValueY = double.Parse(this.tbTranslateValue.Text);
        newValueY = oldValueY + deltaTransformation.Translation.Y / TxApplication.Options.Units.LinearMultiplier;
      }
      else if (!TxDoubleExtension.AlmostEquals(deltaTransformation.Translation.Z, 0.0))
      {
        if (!this.rbZ.Checked)
          this.rbZ.Checked = true;
        oldValueZ = double.Parse(this.tbTranslateValue.Text);
        newValueZ = oldValueZ + deltaTransformation.Translation.Z / TxApplication.Options.Units.LinearMultiplier;
      }
      ITxLocatableObject selectedObject = ((Collection<ITxObject>) this.txOgObjects.SelectedObjects)[0] as ITxLocatableObject;
      TxObjectList locations = new TxObjectList();
      ((Collection<ITxObject>) locations).Add((ITxObject) selectedObject);
      TxTransformation absoluteLocation1 = selectedObject.AbsoluteLocation;
      bool updateStateOnRollback = false;
      this.Translate(oldValueX, newValueX, oldValueY, newValueY, oldValueZ, newValueZ, locations, updateStateOnRollback);
      bool flag = this._sharedLogic.LastGunAndRobotOnLocationState == CApMlmSharedLogic.eGunAndRobotOnLocationState.Success;
      if (!flag && absoluteLocation1.Equals((object) selectedObject.AbsoluteLocation))
        return;
      TxTransformation absoluteLocation2 = selectedObject.AbsoluteLocation;
      TxTransformation txTransformation = TxTransformationEx.Delta(absoluteLocation1, absoluteLocation2);
      if (this.rbX.Checked)
        this.tbTranslateValue.Text = newValueX.ToString("F" + TxApplication.Options.Units.LinearDigitsAfterDecimalPoint.ToString());
      else if (this.rbY.Checked)
        this.tbTranslateValue.Text = newValueY.ToString("F" + TxApplication.Options.Units.LinearDigitsAfterDecimalPoint.ToString());
      else if (this.rbZ.Checked)
        this.tbTranslateValue.Text = newValueZ.ToString("F" + TxApplication.Options.Units.LinearDigitsAfterDecimalPoint.ToString());
      if (!flag && TxTransformation.op_Equality(txTransformation, new TxTransformation()))
      {
        newValueX = oldValueX;
        newValueY = oldValueY;
        newValueZ = oldValueZ;
      }
      this.Translate(oldValueX, newValueX, oldValueY, newValueY, oldValueZ, newValueZ, this.GetAllLocationsWithoutTheSelectedOne());
    }
    else
    {
      if (TxDoubleExtension.AlmostEquals(deltaTransformation.RotationRPY_XYZ.X, 0.0) && TxDoubleExtension.AlmostEquals(deltaTransformation.RotationRPY_XYZ.Y, 0.0) && TxDoubleExtension.AlmostEquals(deltaTransformation.RotationRPY_XYZ.Z, 0.0))
        return;
      double oldValue = double.Parse(this.tbRotateValue.Text);
      double newValue = 0.0;
      if (!TxDoubleExtension.AlmostEquals(deltaTransformation.RotationRPY_XYZ.X, 0.0))
      {
        if (!this.rbRx.Checked)
          this.rbRx.Checked = true;
        newValue = oldValue + deltaTransformation.RotationRPY_XYZ.X / TxApplication.Options.Units.AngularMultiplier;
      }
      if (!TxDoubleExtension.AlmostEquals(deltaTransformation.RotationRPY_XYZ.Y, 0.0))
      {
        if (!this.rbRy.Checked)
          this.rbRy.Checked = true;
        newValue = oldValue + deltaTransformation.RotationRPY_XYZ.Y / TxApplication.Options.Units.AngularMultiplier;
      }
      if (!TxDoubleExtension.AlmostEquals(deltaTransformation.RotationRPY_XYZ.Z, 0.0))
      {
        if (!this.rbRz.Checked)
          this.rbRz.Checked = true;
        newValue = oldValue + deltaTransformation.RotationRPY_XYZ.Z / TxApplication.Options.Units.AngularMultiplier;
      }
      ITxLocatableObject selectedObject = ((Collection<ITxObject>) this.txOgObjects.SelectedObjects)[0] as ITxLocatableObject;
      TxObjectList locations = new TxObjectList();
      ((Collection<ITxObject>) locations).Add((ITxObject) selectedObject);
      TxTransformation absoluteLocation3 = selectedObject.AbsoluteLocation;
      bool updateStateOnRollback = false;
      this.Rotate(oldValue, newValue, locations, updateStateOnRollback);
      bool flag = this._sharedLogic.LastGunAndRobotOnLocationState == CApMlmSharedLogic.eGunAndRobotOnLocationState.Success;
      if (!flag && absoluteLocation3.Equals((object) selectedObject.AbsoluteLocation))
        return;
      TxTransformation absoluteLocation4 = selectedObject.AbsoluteLocation;
      TxTransformation txTransformation = TxTransformationEx.Delta(absoluteLocation3, absoluteLocation4);
      this.tbRotateValue.Text = newValue.ToString("F" + TxApplication.Options.Units.AngularDigitsAfterDecimalPoint.ToString());
      if (!flag && TxTransformation.op_Equality(txTransformation, new TxTransformation()))
      {
        if (this.rbRx.Checked)
          newValue = oldValue;
        else if (this.rbRy.Checked)
          newValue = oldValue;
        else if (this.rbRz.Checked)
          newValue = oldValue;
      }
      this.Rotate(oldValue, newValue, this.GetAllLocationsWithoutTheSelectedOne());
    }
  }

  public void ManipulateViaPlacement(TxTransformation deltaTransformation)
  {
    this._wereChangesMade = true;
    try
    {
      this._manipulateViaPlacement = true;
      this.UpdateTranslationOrRotationValue(deltaTransformation);
      this._sharedLogic.SetGunAndRobotOnLocation(((Collection<ITxObject>) this.txOgObjects.Objects)[this._indexOfLeadingObjectInTheList] as ITxLocationOperation);
    }
    finally
    {
      this._manipulateViaPlacement = false;
    }
  }

  private TxObjectList GetAllLocationsWithoutTheSelectedOne()
  {
    TxObjectList withoutTheSelectedOne = new TxObjectList();
    if (((Collection<ITxObject>) this.txOgObjects.SelectedObjects).Count == 1)
    {
      foreach (ITxObject itxObject in (Collection<ITxObject>) this.txOgObjects.Objects)
      {
        if (itxObject != ((Collection<ITxObject>) this.txOgObjects.SelectedObjects)[0])
          ((Collection<ITxObject>) withoutTheSelectedOne).Add(itxObject);
      }
    }
    return withoutTheSelectedOne;
  }

  private void RefreshManipulatorDisplay()
  {
    if (this._indexOfLeadingObjectInTheList >= 0)
    {
      if (this._indexOfLeadingObjectInTheList < ((Collection<ITxObject>) this.txOgObjects.Objects).Count)
      {
        try
        {
          this.Placement.Deactivate();
          ITxLocatableObject itxLocatableObject = ((Collection<ITxObject>) this.txOgObjects.Objects)[this._indexOfLeadingObjectInTheList] as ITxLocatableObject;
          TxObjectList txObjectList = new TxObjectList(this.txOgObjects.Objects);
          this.Placement.Activate(new TxPlacementManipulatorParameters(!TxTransformation.op_Inequality(this.currentReferenceFrame, (TxTransformation) null) ? (ITxObject) itxLocatableObject : (ITxObject) this._sharedLogic.GetPlacementManipulatorFrameWithLocationSet(new TxTransformation(itxLocatableObject.AbsoluteLocation.Translation, this.currentReferenceFrame.RotationRPY_XYZ, (TxTransformation.TxRotationType) 1)), (TxPlacementManipulatorPosition) 1), new Action<TxTransformation>(this.ManipulateViaPlacement));
          this.RefreshPlacementManipulatorAxes();
          this.RefreshPlacementManipulatorReferenceFrame();
          TxApplication.RefreshDisplay();
          ((Control) this).Focus();
        }
        catch (Exception ex)
        {
        }
      }
    }
    ((Control) this).Focus();
  }

  private void RefreshPlacementManipulatorAxes()
  {
    if (this._manipulateViaPlacement)
      return;
    TxPlacementManipulatorElement manipulatorElement = (TxPlacementManipulatorElement) 0;
    if (this.rbX.Checked)
      manipulatorElement = (TxPlacementManipulatorElement) 1;
    else if (this.rbY.Checked)
      manipulatorElement = (TxPlacementManipulatorElement) 4;
    else if (this.rbZ.Checked)
      manipulatorElement = (TxPlacementManipulatorElement) 7;
    else if (this.rbRz.Checked)
      manipulatorElement = (TxPlacementManipulatorElement) 8;
    else if (this.rbRy.Checked)
      manipulatorElement = (TxPlacementManipulatorElement) 5;
    else if (this.rbRx.Checked)
      manipulatorElement = (TxPlacementManipulatorElement) 2;
    this.Placement.SelectedAxis = manipulatorElement;
  }

  private void RefreshPlacementManipulatorReferenceFrame()
  {
    string name = (string) null;
    TxTransformation location = (TxTransformation) null;
    if (this.m_eachRelativeToOriginalProjectionRdBtn.Checked)
    {
      name = this._sharedLogic.ProjectionFrameDisplayName;
      location = this._sharedLogic.ProjectionFrameLocation;
    }
    else if (this.m_relativeToFrameRdBtn.Checked)
    {
      string text = ((Control) this.m_txFrameComboBoxCtrlRelative).Text;
      if (text != null)
      {
        name = text;
        location = this._currentReferenceFrame;
      }
    }
    this.Placement.RefreshReferenceFrame(name, location);
  }

  private void _placementManipulator_ElementPicked()
  {
    if (!this.Placement.IsActive())
      return;
    try
    {
      this._manipulateViaPlacement = true;
      switch ((int) this.Placement.SelectedAxis)
      {
        case 0:
        case 10:
        case 12:
        case 14:
          this.rbX.Checked = false;
          this.rbY.Checked = false;
          this.rbZ.Checked = false;
          this.rbRz.Checked = false;
          this.rbRx.Checked = false;
          this.rbRy.Checked = false;
          break;
        case 1:
          if (this.rbX.Checked)
            break;
          this.rbX.Checked = true;
          break;
        case 2:
          if (this.rbRx.Checked)
            break;
          this.rbRx.Checked = true;
          break;
        case 4:
          if (this.rbY.Checked)
            break;
          this.rbY.Checked = true;
          break;
        case 5:
          if (this.rbRy.Checked)
            break;
          this.rbRy.Checked = true;
          break;
        case 7:
          if (this.rbZ.Checked)
            break;
          this.rbZ.Checked = true;
          break;
        case 8:
          if (this.rbRz.Checked)
            break;
          this.rbRz.Checked = true;
          break;
      }
    }
    finally
    {
      this._manipulateViaPlacement = false;
    }
  }

  private void RobotFollowMode()
  {
    ITxLocationOperation location = (ITxLocationOperation) null;
    if (this._indexOfLeadingObjectInTheList >= 0)
      location = ((Collection<ITxObject>) this.txOgObjects.Objects)[this._indexOfLeadingObjectInTheList] as ITxLocationOperation;
    this._sharedLogic.RobotFollowMode(location, this.cbFollowMode.Checked);
    TxApplication.RefreshDisplay();
  }

  private void tsbResetLocationsAbsoluteLocation_Click(object sender, EventArgs e)
  {
    this._sharedLogic.ResetAbsoluteLocation(this.TxObjectListToList(this.txOgObjects.Objects));
    this.UpdateListStatus();
    this._sharedLogic.FollowMode(this.cbFollowMode.Checked);
    this.ClearLastLocationDeltas();
    this._translateValue = 0.0;
    this._rotateValue = 0.0;
    this._wereChangesMade = false;
    this.InitZeroValues();
  }

  private void tsbSnapLocationsToMaxAllowed_Click(object sender, EventArgs e)
  {
    this._sharedLogic.SnapToMaxAloowed(this.TxObjectListToList(this.txOgObjects.Objects));
    this.UpdateListStatus();
    this._sharedLogic.FollowMode(this.cbFollowMode.Checked);
  }

  private void tsbFlipLocation1_Click(object sender, EventArgs e)
  {
    new TxCommandManager().ExecuteCommandByCommandProgId("WeldLocationsManipulation.FlipLocsCmd.1", (object) this.txOgObjects.Objects, false);
    this.LocationGraphicsRefresh();
  }

  private void tsbFlipLocation2_Click(object sender, EventArgs e)
  {
    new TxCommandManager().ExecuteCommandByCommandProgId("CCoAFWFlipWeldLocationCmd", (object) this.txOgObjects.Objects, false);
  }

  private void LocationGraphicsRefresh()
  {
    this.RefreshFollowMode();
    this._sharedLogic.GraphicsRefresh();
  }

  private void RefreshFollowMode()
  {
    if (this._indexOfLeadingObjectInTheList < 0)
      return;
    ITxRoboticLocationOperation location = ((Collection<ITxObject>) this.txOgObjects.Objects)[this._indexOfLeadingObjectInTheList] as ITxRoboticLocationOperation;
    bool flag = this.cbFollowMode.Checked;
    this._sharedLogic.FollowMode(flag);
    this._sharedLogic.RobotFollowMode((ITxLocationOperation) location, flag);
    this.RefreshManipulatorDisplay();
  }

  private void tsbShowCone_Click(object sender, EventArgs e)
  {
    ITxRoboticLocationOperation locationOperation = (ITxRoboticLocationOperation) null;
    if (this._indexOfLeadingObjectInTheList >= 0)
      locationOperation = ((Collection<ITxObject>) this.txOgObjects.Objects)[this._indexOfLeadingObjectInTheList] as ITxRoboticLocationOperation;
    this._sharedLogic.Location = (ITxLocationOperation) locationOperation;
    bool flag = ((ToolStripButton) this.tsbShowCone).Checked && !this._sharedLogic.CanCreateConeManipulator();
    if (flag)
      ((ToolStripButton) this.tsbShowCone).Checked = false;
    this._sharedLogic.ShowConeManipulator = ((ToolStripButton) this.tsbShowCone).Checked;
    this._sharedLogic.GraphicsRefresh();
    if (((ToolStripButton) this.tsbShowCone).Checked)
      this._sharedLogic.ZoomToSelection();
    if (!flag)
      return;
    int num = (int) TxMessageBox.ShowModal(MlmStringTable.ResourceManager.GetString("MLM_SHOW_LOCATION_LIMITS_INFO"), MlmStringTable.ResourceManager.GetString("MULTIPLE_LOCATIONS_MANIPULATION_NAME"), MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  }

  private void txOgObjects_GotFocus(object sender, EventArgs e) => this.RefFrameLoseFocus();

  private void RefFrameLoseFocus()
  {
    this._sharedLogic.BlankBoldFrame();
    this.m_txFrameComboBoxCtrlRelative.ListenToPick = false;
    this.m_txFrameComboBoxCtrlRelative.Enabled = false;
    this.m_txFrameComboBoxCtrlRelative.LoseFocus();
    ((Control) this.m_txFrameComboBoxCtrlRelative).Refresh();
  }

  private void m_eachRelativeToOriginalProjectionRdBtn_CheckedChanged(object sender, EventArgs e)
  {
    this._sharedLogic.UpdateProjectionFrame(this.m_eachRelativeToOriginalProjectionRdBtn.Checked, this._projectedLocation);
    if (!this.m_eachRelativeToOriginalProjectionRdBtn.Checked && !this.m_eachRelativeToSelfFrameRdBtn.Checked)
      return;
    this.RefreshManipulatorDisplay();
  }

  private void m_relativeToFrameRdBtn_CheckChanged(object sender, EventArgs e)
  {
    if (this.m_relativeToFrameRdBtn.Checked)
    {
      this._sharedLogic.DisplayBoldFrame();
      this.m_txFrameComboBoxCtrlRelative.Enabled = true;
      this.m_txFrameComboBoxCtrlRelative.ListenToPick = true;
      this.m_txFrameComboBoxCtrlRelative.Focus();
      ((Control) this.m_txFrameComboBoxCtrlRelative).Refresh();
      this.txOgObjects.LoseFocus();
    }
    else
      this.RefFrameLoseFocus();
    if (!this.m_relativeToFrameRdBtn.Checked && !this.m_eachRelativeToSelfFrameRdBtn.Checked)
      return;
    this.RefreshManipulatorDisplay();
  }

  private void txOgObjects_BeforeLoseFocus(object arg1, EventArgs arg2)
  {
    this.OnGridSelectionChanged(-1);
  }

  private void m_txFrameComboBoxCtrlRelative_LostFocus(object sender, EventArgs e)
  {
    if (this.isFrameOfReferenceValid)
      return;
    this.m_txFrameComboBoxCtrlRelative.SelectFrame(MlmStringTable.ResourceManager.GetString("MLM_WORKING_FRAME"));
  }

  private void m_txFrameComboBoxCtrlRelative_ValidFrameSet(
    object sender,
    TxFrameComboBoxCtrl_ValidFrameSetEventArgs args)
  {
    this.isFrameOfReferenceValid = true;
    this._currentReferenceFrame = args.Location;
    this._sharedLogic.ClearBoldFrame();
    this._sharedLogic.CreateBoldFrame(args.Location);
    if (this._manipulateViaPlacement)
      return;
    this.RefreshManipulatorDisplay();
    TxApplication.RefreshDisplay();
  }

  private void m_txFrameComboBoxCtrlRelative_InvalidFrameSet(
    object sender,
    TxFrameComboBoxCtrl_InvalidFrameSetEventArgs args)
  {
    this.isFrameOfReferenceValid = false;
  }

  private void RefreshFrameOfReferenceLocation()
  {
    if (!TxTransformation.op_Inequality(this.currentReferenceFrame, (TxTransformation) null) || this.txOgObjects.SelectedObjects == null || ((Collection<ITxObject>) this.txOgObjects.SelectedObjects).Count <= 0)
      return;
    this._sharedLogic.GetPlacementManipulatorFrameWithLocationSet(new TxTransformation((((Collection<ITxObject>) this.txOgObjects.SelectedObjects)[0] as ITxLocatableObject).AbsoluteLocation.Translation, this.currentReferenceFrame.RotationRPY_XYZ, (TxTransformation.TxRotationType) 1));
  }

  private void CCUiMlmMultipleLocationsManipulationDlg_FormClosed(
    object sender,
    FormClosedEventArgs e)
  {
    TxGraphicViewerEx.PickLevel = this._originalPickLevel;
  }

  private TxTransformation GetProjectedLocation(int index)
  {
    TxTransformation projectedLocation = (TxTransformation) null;
    if (((Collection<ITxObject>) this.txOgObjects.Objects).Count > index && index >= 0 && this._locationTransformation != null && this._locationTransformation.Count > index)
      projectedLocation = this._locationTransformation[index].Item2;
    return projectedLocation;
  }

  private void SetProjectedLocation(int index)
  {
    this._projectedLocation = this.GetProjectedLocation(index);
  }

  private TxTransformation GetCurrentReferenceFrame(int index)
  {
    if (this.m_eachRelativeToSelfFrameRdBtn.Checked)
      return (TxTransformation) null;
    return this.m_eachRelativeToOriginalProjectionRdBtn.Checked ? this.GetProjectedLocation(index) : this._currentReferenceFrame;
  }

  private bool IsWeldOrSeamLocationOperation(ITxLocationOperation operation)
  {
    bool flag = false;
    if (operation != null)
      flag = operation is TxWeldLocationOperation || operation is TxRoboticSeamLocationOperation;
    return flag;
  }

  protected virtual void Dispose(bool disposing)
  {
    if (disposing && this.components != null)
      this.components.Dispose();
    base.Dispose(disposing);
  }

  private void InitializeComponent()
  {
    this.components = (IContainer) new Container();
    ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (CCUiMlmMultipleLocationsManipulationDlg));
    this.lblTranslateAlong = new Label();
    this.lblRotateArround = new Label();
    this.cbLimitOptions = new CheckBox();
    this.cbRotateToMaximum = new CheckBox();
    this.txOgObjects = new TxObjGridCtrl();
    this.btnClose = new Button();
    this.btnReset = new Button();
    this.btnTranslateLeft = new CUiContinuousButton();
    this.ilSmallButtonsImages = new ImageList(this.components);
    this.llTranslateStep = new TxLinkLabel();
    this.tbTranslateValue = new TextBox();
    this.btnTranslateRight = new CUiContinuousButton();
    this.textBox1t = new TextBox();
    this.btnRotateRight = new CUiContinuousButton();
    this.tbRotateValue = new TextBox();
    this.llRotateStep = new TxLinkLabel();
    this.btnRotateLeft = new CUiContinuousButton();
    this.rbX = new RadioButton();
    this.rbZ = new RadioButton();
    this.rbY = new RadioButton();
    this.rbRz = new RadioButton();
    this.rbRy = new RadioButton();
    this.rbRx = new RadioButton();
    this.gbTranslation = new GroupBox();
    this.lblApplyTranslationAxis = new Label();
    this.ilLargeButtonsImages = new ImageList(this.components);
    this.gbRotate = new GroupBox();
    this.lblApplyRotationAxis = new Label();
    this.gbSettings = new GroupBox();
    this.cbFollowMode = (CheckBox) new TxCheckBox();
    this.ttButtonsTooltip = new ToolTip(this.components);
    this.toolStrip1 = new TxToolStrip();
    this.tsbResetLocationsAbsoluteLocation = new TxToolStripButton();
    this.tsbSnapLocationsToMaxAllowed = new TxToolStripButton();
    this.toolStripFlipDropDownButton1 = new TxToolStripDropDownButton();
    this.tsbFlipLocation1 = new TxToolStripMenuItem();
    this.tsbFlipLocation2 = new TxToolStripMenuItem();
    this.toolStripSeparator1 = new ToolStripSeparator();
    this.tsbShowCone = new TxToolStripButton();
    this.ilNavigationButtonIcons = new ImageList(this.components);
    this.ttNavigationControl = new ToolTip(this.components);
    this.m_eachRelativeToSelfFrameRdBtn = new RadioButton();
    this.m_relativeToFrameRdBtn = new RadioButton();
    this.m_txFrameComboBoxCtrlRelative = new TxFrameComboBoxCtrl();
    this.gbFrameRef = new GroupBox();
    this.m_eachRelativeToOriginalProjectionRdBtn = new RadioButton();
    this.txbcbApplyTranslationAxis = new TxButtonComboBox();
    this.txbcbApplyRotationAxis = new TxButtonComboBox();
    this.gbTranslation.SuspendLayout();
    this.gbRotate.SuspendLayout();
    this.gbSettings.SuspendLayout();
    ((Control) this.toolStrip1).SuspendLayout();
    this.gbFrameRef.SuspendLayout();
    ((Control) this).SuspendLayout();
    componentResourceManager.ApplyResources((object) this.lblTranslateAlong, "lblTranslateAlong");
    this.lblTranslateAlong.Name = "lblTranslateAlong";
    componentResourceManager.ApplyResources((object) this.lblRotateArround, "lblRotateArround");
    this.lblRotateArround.Name = "lblRotateArround";
    componentResourceManager.ApplyResources((object) this.cbLimitOptions, "cbLimitOptions");
    this.cbLimitOptions.Checked = true;
    this.cbLimitOptions.CheckState = CheckState.Checked;
    this.cbLimitOptions.Name = "cbLimitOptions";
    this.cbLimitOptions.UseVisualStyleBackColor = true;
    this.cbLimitOptions.CheckedChanged += new EventHandler(this.cbLimitOptions_CheckedChanged);
    componentResourceManager.ApplyResources((object) this.cbRotateToMaximum, "cbRotateToMaximum");
    this.cbRotateToMaximum.Name = "cbRotateToMaximum";
    this.cbRotateToMaximum.UseVisualStyleBackColor = true;
    this.cbRotateToMaximum.CheckedChanged += new EventHandler(this.cbRotateToMaximum_CheckedChanged);
    componentResourceManager.ApplyResources((object) this.txOgObjects, "txOgObjects");
    ((UserControl) this.txOgObjects).BorderStyle = BorderStyle.FixedSingle;
    this.txOgObjects.ChangeGeneralSelection = false;
    this.txOgObjects.CurrentRow = -1;
    this.txOgObjects.EnableMultipleSelection = false;
    this.txOgObjects.EnableRecurringObjects = false;
    this.txOgObjects.ListenToPick = false;
    ((Control) this.txOgObjects).Name = "txOgObjects";
    this.txOgObjects.PickLevel = (TxPickLevel) 1;
    this.txOgObjects.ReadOnly = false;
    this.txOgObjects.ValidatorType = (TxValidatorType) 11;
    this.txOgObjects.ObjectDeleting += new TxObjGridCtrl_ObjectDeletingEventHandler(this.txOgObjects_ObjectDeleting);
    this.txOgObjects.ObjectInserted += new TxObjGridCtrl_ObjectInsertedEventHandler(this.txOgObjects_ObjectInserted);
    this.txOgObjects.Picked += new TxObjGridCtrl_PickedEventHandler(this.txOgObjects_Picked);
    this.txOgObjects.SelectionChanged += new TxObjGridCtrl_SelectionChangedEventHandler(this.txOgObjects_SelectionChanged);
    componentResourceManager.ApplyResources((object) this.btnClose, "btnClose");
    this.btnClose.Name = "btnClose";
    this.btnClose.UseVisualStyleBackColor = true;
    this.btnClose.Click += new EventHandler(this.btnClose_Click);
    this.btnClose.KeyDown += new KeyEventHandler(this.CheckShift);
    this.btnClose.KeyUp += new KeyEventHandler(this.CheckShift);
    componentResourceManager.ApplyResources((object) this.btnReset, "btnReset");
    this.btnReset.Name = "btnReset";
    this.btnReset.UseVisualStyleBackColor = true;
    this.btnReset.Click += new EventHandler(this.btnReset_Click);
    this.btnTranslateLeft.ClickInterval = 200;
    componentResourceManager.ApplyResources((object) this.btnTranslateLeft, "btnTranslateLeft");
    ((ButtonBase) this.btnTranslateLeft).ImageList = this.ilSmallButtonsImages;
    ((Control) this.btnTranslateLeft).Name = "btnTranslateLeft";
    this.ttButtonsTooltip.SetToolTip((Control) this.btnTranslateLeft, componentResourceManager.GetString("btnTranslateLeft.ToolTip"));
    ((ButtonBase) this.btnTranslateLeft).UseVisualStyleBackColor = true;
    this.btnTranslateLeft.ContinuousClick += new EventHandler(this.btnTranslateLeft_ContinuousClick);
    this.btnTranslateLeft.ContinuousClickStarted += new EventHandler(this.btnTranslateLeft_ContinuousClickStarted);
    this.btnTranslateLeft.ContinuousClickEnded += new EventHandler(this.btnTranslateLeft_ContinuousClickEnded);
    ((Control) this.btnTranslateLeft).KeyDown += new KeyEventHandler(this.CheckShift);
    ((Control) this.btnTranslateLeft).KeyUp += new KeyEventHandler(this.CheckShift);
    this.ilSmallButtonsImages.ImageStream = (ImageListStreamer) componentResourceManager.GetObject("ilSmallButtonsImages.ImageStream");
    this.ilSmallButtonsImages.TransparentColor = Color.Fuchsia;
    this.ilSmallButtonsImages.Images.SetKeyName(0, "MoveLeft.png");
    this.ilSmallButtonsImages.Images.SetKeyName(1, "MoveRight.png");
    componentResourceManager.ApplyResources((object) this.llTranslateStep, "llTranslateStep");
    ((Control) this.llTranslateStep).Name = "llTranslateStep";
    ((LinkLabel) this.llTranslateStep).TabStop = true;
    this.ttButtonsTooltip.SetToolTip((Control) this.llTranslateStep, componentResourceManager.GetString("llTranslateStep.ToolTip"));
    ((LinkLabel) this.llTranslateStep).LinkClicked += new LinkLabelLinkClickedEventHandler(this.llTranslateStep_LinkClicked);
    this.tbTranslateValue.AcceptsReturn = true;
    componentResourceManager.ApplyResources((object) this.tbTranslateValue, "tbTranslateValue");
    this.tbTranslateValue.Name = "tbTranslateValue";
    this.tbTranslateValue.Enter += new EventHandler(this.tbTranslateValue_Enter);
    this.tbTranslateValue.KeyDown += new KeyEventHandler(this.tbTranslateValue_KeyDown);
    this.tbTranslateValue.Leave += new EventHandler(this.tbTranslateValue_Leave);
    this.btnTranslateRight.ClickInterval = 200;
    componentResourceManager.ApplyResources((object) this.btnTranslateRight, "btnTranslateRight");
    ((ButtonBase) this.btnTranslateRight).ImageList = this.ilSmallButtonsImages;
    ((Control) this.btnTranslateRight).Name = "btnTranslateRight";
    this.ttButtonsTooltip.SetToolTip((Control) this.btnTranslateRight, componentResourceManager.GetString("btnTranslateRight.ToolTip"));
    ((ButtonBase) this.btnTranslateRight).UseVisualStyleBackColor = true;
    this.btnTranslateRight.ContinuousClick += new EventHandler(this.btnTranslateRight_ContinuousClick);
    this.btnTranslateRight.ContinuousClickStarted += new EventHandler(this.btnTranslateLeft_ContinuousClickStarted);
    this.btnTranslateRight.ContinuousClickEnded += new EventHandler(this.btnTranslateLeft_ContinuousClickEnded);
    ((Control) this.btnTranslateRight).KeyDown += new KeyEventHandler(this.CheckShift);
    ((Control) this.btnTranslateRight).KeyUp += new KeyEventHandler(this.CheckShift);
    componentResourceManager.ApplyResources((object) this.textBox1t, "textBox1t");
    this.textBox1t.Name = "textBox1t";
    this.btnRotateRight.ClickInterval = 200;
    componentResourceManager.ApplyResources((object) this.btnRotateRight, "btnRotateRight");
    ((ButtonBase) this.btnRotateRight).ImageList = this.ilSmallButtonsImages;
    ((Control) this.btnRotateRight).Name = "btnRotateRight";
    this.ttButtonsTooltip.SetToolTip((Control) this.btnRotateRight, componentResourceManager.GetString("btnRotateRight.ToolTip"));
    ((ButtonBase) this.btnRotateRight).UseVisualStyleBackColor = true;
    this.btnRotateRight.ContinuousClick += new EventHandler(this.btnRotateRight_ContinuousClick);
    this.btnRotateRight.ContinuousClickStarted += new EventHandler(this.btnTranslateLeft_ContinuousClickStarted);
    this.btnRotateRight.ContinuousClickEnded += new EventHandler(this.btnTranslateLeft_ContinuousClickEnded);
    this.tbRotateValue.AcceptsReturn = true;
    componentResourceManager.ApplyResources((object) this.tbRotateValue, "tbRotateValue");
    this.tbRotateValue.Name = "tbRotateValue";
    this.tbRotateValue.Enter += new EventHandler(this.tbRotateValue_Enter);
    this.tbRotateValue.KeyDown += new KeyEventHandler(this.tbRotateValue_KeyDown);
    this.tbRotateValue.Leave += new EventHandler(this.tbRotateValue_Leave);
    componentResourceManager.ApplyResources((object) this.llRotateStep, "llRotateStep");
    ((Control) this.llRotateStep).Name = "llRotateStep";
    ((LinkLabel) this.llRotateStep).TabStop = true;
    this.ttButtonsTooltip.SetToolTip((Control) this.llRotateStep, componentResourceManager.GetString("llRotateStep.ToolTip"));
    ((LinkLabel) this.llRotateStep).LinkClicked += new LinkLabelLinkClickedEventHandler(this.llRotateStep_LinkClicked);
    this.btnRotateLeft.ClickInterval = 200;
    componentResourceManager.ApplyResources((object) this.btnRotateLeft, "btnRotateLeft");
    ((ButtonBase) this.btnRotateLeft).ImageList = this.ilSmallButtonsImages;
    ((Control) this.btnRotateLeft).Name = "btnRotateLeft";
    this.ttButtonsTooltip.SetToolTip((Control) this.btnRotateLeft, componentResourceManager.GetString("btnRotateLeft.ToolTip"));
    ((ButtonBase) this.btnRotateLeft).UseVisualStyleBackColor = true;
    this.btnRotateLeft.ContinuousClick += new EventHandler(this.btnRotateLeft_ContinuousClick);
    this.btnRotateLeft.ContinuousClickStarted += new EventHandler(this.btnTranslateLeft_ContinuousClickStarted);
    this.btnRotateLeft.ContinuousClickEnded += new EventHandler(this.btnTranslateLeft_ContinuousClickEnded);
    ((Control) this.btnRotateLeft).KeyDown += new KeyEventHandler(this.CheckShift);
    ((Control) this.btnRotateLeft).KeyUp += new KeyEventHandler(this.CheckShift);
    componentResourceManager.ApplyResources((object) this.rbX, "rbX");
    this.rbX.Checked = true;
    this.rbX.Name = "rbX";
    this.rbX.TabStop = true;
    this.ttButtonsTooltip.SetToolTip((Control) this.rbX, componentResourceManager.GetString("rbX.ToolTip"));
    this.rbX.UseVisualStyleBackColor = true;
    this.rbX.CheckedChanged += new EventHandler(this.rbX_CheckedChanged);
    this.rbX.KeyDown += new KeyEventHandler(this.CheckShift);
    this.rbX.KeyUp += new KeyEventHandler(this.CheckShift);
    componentResourceManager.ApplyResources((object) this.rbZ, "rbZ");
    this.rbZ.Name = "rbZ";
    this.rbZ.TabStop = true;
    this.ttButtonsTooltip.SetToolTip((Control) this.rbZ, componentResourceManager.GetString("rbZ.ToolTip"));
    this.rbZ.UseVisualStyleBackColor = true;
    this.rbZ.CheckedChanged += new EventHandler(this.rbZ_CheckedChanged);
    this.rbZ.KeyDown += new KeyEventHandler(this.CheckShift);
    this.rbZ.KeyUp += new KeyEventHandler(this.CheckShift);
    componentResourceManager.ApplyResources((object) this.rbY, "rbY");
    this.rbY.Name = "rbY";
    this.rbY.TabStop = true;
    this.ttButtonsTooltip.SetToolTip((Control) this.rbY, componentResourceManager.GetString("rbY.ToolTip"));
    this.rbY.UseVisualStyleBackColor = true;
    this.rbY.CheckedChanged += new EventHandler(this.rbY_CheckedChanged);
    this.rbY.KeyDown += new KeyEventHandler(this.CheckShift);
    this.rbY.KeyUp += new KeyEventHandler(this.CheckShift);
    componentResourceManager.ApplyResources((object) this.rbRz, "rbRz");
    this.rbRz.Name = "rbRz";
    this.rbRz.TabStop = true;
    this.ttButtonsTooltip.SetToolTip((Control) this.rbRz, componentResourceManager.GetString("rbRz.ToolTip"));
    this.rbRz.UseVisualStyleBackColor = true;
    this.rbRz.CheckedChanged += new EventHandler(this.rbRz_CheckedChanged);
    this.rbRz.KeyDown += new KeyEventHandler(this.CheckShift);
    this.rbRz.KeyUp += new KeyEventHandler(this.CheckShift);
    componentResourceManager.ApplyResources((object) this.rbRy, "rbRy");
    this.rbRy.Name = "rbRy";
    this.rbRy.TabStop = true;
    this.ttButtonsTooltip.SetToolTip((Control) this.rbRy, componentResourceManager.GetString("rbRy.ToolTip"));
    this.rbRy.UseVisualStyleBackColor = true;
    this.rbRy.CheckedChanged += new EventHandler(this.rbRy_CheckedChanged);
    this.rbRy.KeyDown += new KeyEventHandler(this.CheckShift);
    this.rbRy.KeyUp += new KeyEventHandler(this.CheckShift);
    componentResourceManager.ApplyResources((object) this.rbRx, "rbRx");
    this.rbRx.Name = "rbRx";
    this.rbRx.TabStop = true;
    this.ttButtonsTooltip.SetToolTip((Control) this.rbRx, componentResourceManager.GetString("rbRx.ToolTip"));
    this.rbRx.UseVisualStyleBackColor = true;
    this.rbRx.CheckedChanged += new EventHandler(this.rbRx_CheckedChanged);
    this.rbRx.KeyDown += new KeyEventHandler(this.CheckShift);
    this.rbRx.KeyUp += new KeyEventHandler(this.CheckShift);
    componentResourceManager.ApplyResources((object) this.gbTranslation, "gbTranslation");
    this.gbTranslation.Controls.Add((Control) this.txbcbApplyTranslationAxis);
    this.gbTranslation.Controls.Add((Control) this.lblApplyTranslationAxis);
    this.gbTranslation.Controls.Add((Control) this.lblTranslateAlong);
    this.gbTranslation.Controls.Add((Control) this.rbX);
    this.gbTranslation.Controls.Add((Control) this.btnTranslateLeft);
    this.gbTranslation.Controls.Add((Control) this.rbY);
    this.gbTranslation.Controls.Add((Control) this.llTranslateStep);
    this.gbTranslation.Controls.Add((Control) this.rbZ);
    this.gbTranslation.Controls.Add((Control) this.tbTranslateValue);
    this.gbTranslation.Controls.Add((Control) this.btnTranslateRight);
    this.gbTranslation.Name = "gbTranslation";
    this.gbTranslation.TabStop = false;
    componentResourceManager.ApplyResources((object) this.lblApplyTranslationAxis, "lblApplyTranslationAxis");
    this.lblApplyTranslationAxis.Name = "lblApplyTranslationAxis";
    this.ilLargeButtonsImages.ImageStream = (ImageListStreamer) componentResourceManager.GetObject("ilLargeButtonsImages.ImageStream");
    this.ilLargeButtonsImages.TransparentColor = Color.Fuchsia;
    this.ilLargeButtonsImages.Images.SetKeyName(0, "RotateApproach.bmp");
    this.ilLargeButtonsImages.Images.SetKeyName(1, "RotateNormal.bmp");
    this.ilLargeButtonsImages.Images.SetKeyName(2, "RotateThird.bmp");
    this.ilLargeButtonsImages.Images.SetKeyName(3, "TranslateNormal.bmp");
    this.ilLargeButtonsImages.Images.SetKeyName(4, "FollowMode.png");
    this.ilLargeButtonsImages.Images.SetKeyName(5, "SnapToMaxAllowed.png");
    this.ilLargeButtonsImages.Images.SetKeyName(6, "ResetAbsoluteLocation.png");
    this.ilLargeButtonsImages.Images.SetKeyName(7, "");
    this.ilLargeButtonsImages.Images.SetKeyName(8, "FlipLocation.png");
    componentResourceManager.ApplyResources((object) this.gbRotate, "gbRotate");
    this.gbRotate.Controls.Add((Control) this.txbcbApplyRotationAxis);
    this.gbRotate.Controls.Add((Control) this.lblApplyRotationAxis);
    this.gbRotate.Controls.Add((Control) this.lblRotateArround);
    this.gbRotate.Controls.Add((Control) this.rbRz);
    this.gbRotate.Controls.Add((Control) this.btnRotateRight);
    this.gbRotate.Controls.Add((Control) this.rbRx);
    this.gbRotate.Controls.Add((Control) this.tbRotateValue);
    this.gbRotate.Controls.Add((Control) this.rbRy);
    this.gbRotate.Controls.Add((Control) this.llRotateStep);
    this.gbRotate.Controls.Add((Control) this.btnRotateLeft);
    this.gbRotate.Name = "gbRotate";
    this.gbRotate.TabStop = false;
    componentResourceManager.ApplyResources((object) this.lblApplyRotationAxis, "lblApplyRotationAxis");
    this.lblApplyRotationAxis.Name = "lblApplyRotationAxis";
    componentResourceManager.ApplyResources((object) this.gbSettings, "gbSettings");
    this.gbSettings.Controls.Add((Control) this.cbLimitOptions);
    this.gbSettings.Controls.Add((Control) this.cbRotateToMaximum);
    this.gbSettings.Name = "gbSettings";
    this.gbSettings.TabStop = false;
    componentResourceManager.ApplyResources((object) this.cbFollowMode, "cbFollowMode");
    this.cbFollowMode.ImageList = this.ilLargeButtonsImages;
    this.cbFollowMode.Name = "cbFollowMode";
    this.cbFollowMode.UseVisualStyleBackColor = true;
    this.cbFollowMode.Click += new EventHandler(this.cbFollowMode_Click);
    this.toolStrip1.BackColor = Color.Transparent;
    this.toolStrip1.ClickThrough = true;
    ((ToolStrip) this.toolStrip1).GripStyle = ToolStripGripStyle.Hidden;
    ((ToolStrip) this.toolStrip1).Items.AddRange(new ToolStripItem[5]
    {
      (ToolStripItem) this.tsbResetLocationsAbsoluteLocation,
      (ToolStripItem) this.tsbSnapLocationsToMaxAllowed,
      (ToolStripItem) this.toolStripFlipDropDownButton1,
      (ToolStripItem) this.toolStripSeparator1,
      (ToolStripItem) this.tsbShowCone
    });
    componentResourceManager.ApplyResources((object) this.toolStrip1, "toolStrip1");
    ((Control) this.toolStrip1).Name = "toolStrip1";
    ((ToolStripItem) this.tsbResetLocationsAbsoluteLocation).DisplayStyle = ToolStripItemDisplayStyle.Image;
    componentResourceManager.ApplyResources((object) this.tsbResetLocationsAbsoluteLocation, "tsbResetLocationsAbsoluteLocation");
    ((ToolStripItem) this.tsbResetLocationsAbsoluteLocation).Name = "tsbResetLocationsAbsoluteLocation";
    ((ToolStripItem) this.tsbResetLocationsAbsoluteLocation).Click += new EventHandler(this.tsbResetLocationsAbsoluteLocation_Click);
    ((ToolStripItem) this.tsbSnapLocationsToMaxAllowed).DisplayStyle = ToolStripItemDisplayStyle.Image;
    componentResourceManager.ApplyResources((object) this.tsbSnapLocationsToMaxAllowed, "tsbSnapLocationsToMaxAllowed");
    ((ToolStripItem) this.tsbSnapLocationsToMaxAllowed).Name = "tsbSnapLocationsToMaxAllowed";
    ((ToolStripItem) this.tsbSnapLocationsToMaxAllowed).Click += new EventHandler(this.tsbSnapLocationsToMaxAllowed_Click);
    ((ToolStripItem) this.toolStripFlipDropDownButton1).DisplayStyle = ToolStripItemDisplayStyle.Image;
    ((ToolStripDropDownItem) this.toolStripFlipDropDownButton1).DropDownItems.AddRange(new ToolStripItem[2]
    {
      (ToolStripItem) this.tsbFlipLocation1,
      (ToolStripItem) this.tsbFlipLocation2
    });
    componentResourceManager.ApplyResources((object) this.toolStripFlipDropDownButton1, "toolStripFlipDropDownButton1");
    ((ToolStripItem) this.toolStripFlipDropDownButton1).Name = "toolStripFlipDropDownButton1";
    componentResourceManager.ApplyResources((object) this.tsbFlipLocation1, "tsbFlipLocation1");
    ((ToolStripItem) this.tsbFlipLocation1).Name = "tsbFlipLocation1";
    ((ToolStripItem) this.tsbFlipLocation1).Click += new EventHandler(this.tsbFlipLocation1_Click);
    componentResourceManager.ApplyResources((object) this.tsbFlipLocation2, "tsbFlipLocation2");
    ((ToolStripItem) this.tsbFlipLocation2).Name = "tsbFlipLocation2";
    ((ToolStripItem) this.tsbFlipLocation2).Click += new EventHandler(this.tsbFlipLocation2_Click);
    this.toolStripSeparator1.Name = "toolStripSeparator1";
    componentResourceManager.ApplyResources((object) this.toolStripSeparator1, "toolStripSeparator1");
    ((ToolStripButton) this.tsbShowCone).CheckOnClick = true;
    ((ToolStripItem) this.tsbShowCone).DisplayStyle = ToolStripItemDisplayStyle.Image;
    componentResourceManager.ApplyResources((object) this.tsbShowCone, "tsbShowCone");
    ((ToolStripItem) this.tsbShowCone).Name = "tsbShowCone";
    ((ToolStripItem) this.tsbShowCone).Click += new EventHandler(this.tsbShowCone_Click);
    this.ilNavigationButtonIcons.ImageStream = (ImageListStreamer) componentResourceManager.GetObject("ilNavigationButtonIcons.ImageStream");
    this.ilNavigationButtonIcons.TransparentColor = Color.Transparent;
    this.ilNavigationButtonIcons.Images.SetKeyName(0, "First.png");
    this.ilNavigationButtonIcons.Images.SetKeyName(1, "Last.png");
    this.ilNavigationButtonIcons.Images.SetKeyName(2, "Next.png");
    this.ilNavigationButtonIcons.Images.SetKeyName(3, "Prev.png");
    componentResourceManager.ApplyResources((object) this.m_eachRelativeToSelfFrameRdBtn, "m_eachRelativeToSelfFrameRdBtn");
    this.m_eachRelativeToSelfFrameRdBtn.Checked = true;
    this.m_eachRelativeToSelfFrameRdBtn.Name = "m_eachRelativeToSelfFrameRdBtn";
    this.m_eachRelativeToSelfFrameRdBtn.TabStop = true;
    this.m_eachRelativeToSelfFrameRdBtn.UseVisualStyleBackColor = true;
    componentResourceManager.ApplyResources((object) this.m_relativeToFrameRdBtn, "m_relativeToFrameRdBtn");
    this.m_relativeToFrameRdBtn.Name = "m_relativeToFrameRdBtn";
    this.m_relativeToFrameRdBtn.TabStop = true;
    this.m_relativeToFrameRdBtn.UseVisualStyleBackColor = true;
    this.m_relativeToFrameRdBtn.CheckedChanged += new EventHandler(this.m_relativeToFrameRdBtn_CheckChanged);
    componentResourceManager.ApplyResources((object) this.m_txFrameComboBoxCtrlRelative, "m_txFrameComboBoxCtrlRelative");
    this.m_txFrameComboBoxCtrlRelative.EnableAdvancedPick = true;
    this.m_txFrameComboBoxCtrlRelative.ListenToPick = false;
    ((Control) this.m_txFrameComboBoxCtrlRelative).Name = "m_txFrameComboBoxCtrlRelative";
    this.m_txFrameComboBoxCtrlRelative.PickLevel = (TxPickLevel) 6;
    this.m_txFrameComboBoxCtrlRelative.VisualizePickedFrameInGraphicViewer = false;
    componentResourceManager.ApplyResources((object) this.gbFrameRef, "gbFrameRef");
    this.gbFrameRef.Controls.Add((Control) this.m_eachRelativeToOriginalProjectionRdBtn);
    this.gbFrameRef.Controls.Add((Control) this.m_txFrameComboBoxCtrlRelative);
    this.gbFrameRef.Controls.Add((Control) this.m_relativeToFrameRdBtn);
    this.gbFrameRef.Controls.Add((Control) this.m_eachRelativeToSelfFrameRdBtn);
    this.gbFrameRef.Name = "gbFrameRef";
    this.gbFrameRef.TabStop = false;
    componentResourceManager.ApplyResources((object) this.m_eachRelativeToOriginalProjectionRdBtn, "m_eachRelativeToOriginalProjectionRdBtn");
    this.m_eachRelativeToOriginalProjectionRdBtn.Name = "m_eachRelativeToOriginalProjectionRdBtn";
    this.m_eachRelativeToOriginalProjectionRdBtn.TabStop = true;
    this.m_eachRelativeToOriginalProjectionRdBtn.UseVisualStyleBackColor = true;
    this.m_eachRelativeToOriginalProjectionRdBtn.CheckedChanged += new EventHandler(this.m_eachRelativeToOriginalProjectionRdBtn_CheckedChanged);
    componentResourceManager.ApplyResources((object) this.txbcbApplyTranslationAxis, "txbcbApplyTranslationAxis");
    ((Control) this.txbcbApplyTranslationAxis).Name = "txbcbApplyTranslationAxis";
    this.txbcbApplyTranslationAxis.SelectedAction = 0;
    this.txbcbApplyTranslationAxis.FireAction += new TxButtonComboBox.FireActionEventHandler(this.txbcbApplyTranslationAxis_FireAction);
    componentResourceManager.ApplyResources((object) this.txbcbApplyRotationAxis, "txbcbApplyRotationAxis");
    ((Control) this.txbcbApplyRotationAxis).Name = "txbcbApplyRotationAxis";
    this.txbcbApplyRotationAxis.SelectedAction = 0;
    this.txbcbApplyRotationAxis.FireAction += new TxButtonComboBox.FireActionEventHandler(this.txbcbApplyRotationAxis_FireAction);
    componentResourceManager.ApplyResources((object) this, "$this");
    ((ContainerControl) this).AutoScaleMode = AutoScaleMode.Font;
    ((Control) this).Controls.Add((Control) this.gbFrameRef);
    ((Control) this).Controls.Add((Control) this.toolStrip1);
    ((Control) this).Controls.Add((Control) this.cbFollowMode);
    ((Control) this).Controls.Add((Control) this.gbSettings);
    ((Control) this).Controls.Add((Control) this.gbRotate);
    ((Control) this).Controls.Add((Control) this.gbTranslation);
    ((Control) this).Controls.Add((Control) this.btnReset);
    ((Control) this).Controls.Add((Control) this.btnClose);
    ((Control) this).Controls.Add((Control) this.txOgObjects);
    ((Form) this).MaximizeBox = false;
    ((Form) this).MinimizeBox = false;
    ((Control) this).Name = nameof (CCUiMlmMultipleLocationsManipulationDlg);
    ((Form) this).SizeGripStyle = SizeGripStyle.Hide;
    ((Form) this).FormClosing += new FormClosingEventHandler(this.CCUiMlmMultipleLocationsManipulationDlg_FormClosing);
    ((Form) this).FormClosed += new FormClosedEventHandler(this.CCUiMlmMultipleLocationsManipulationDlg_FormClosed);
    this.gbTranslation.ResumeLayout(false);
    this.gbTranslation.PerformLayout();
    this.gbRotate.ResumeLayout(false);
    this.gbRotate.PerformLayout();
    this.gbSettings.ResumeLayout(false);
    this.gbSettings.PerformLayout();
    ((Control) this.toolStrip1).ResumeLayout(false);
    ((Control) this.toolStrip1).PerformLayout();
    this.gbFrameRef.ResumeLayout(false);
    this.gbFrameRef.PerformLayout();
    ((Control) this).ResumeLayout(false);
    ((Control) this).PerformLayout();
  }
}
